Module: Machinist

Defined in:
lib/machinist.rb,
lib/machinist/object.rb,
lib/machinist/blueprints.rb,
lib/machinist/data_mapper.rb,
lib/machinist/active_record.rb

Defined Under Namespace

Modules: ActiveRecordExtensions, ActiveRecordHasManyExtensions, Blueprints, DataMapperExtensions, ObjectExtensions Classes: ActiveRecordAdapter, DataMapperAdapter, Lathe, ObjectAdapter

Constant Summary collapse

@@nerfed =
false

Class Method Summary collapse

Class Method Details

.nerfed?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/machinist.rb', line 96

def self.nerfed?
  @@nerfed
end

.with_save_nerfedObject

This sets a flag that stops make from saving objects, so that calls to make from within a blueprint don’t create anything inside make_unsaved.



86
87
88
89
90
91
92
93
# File 'lib/machinist.rb', line 86

def self.with_save_nerfed
  begin
    @@nerfed = true
    yield
  ensure
    @@nerfed = false
  end
end