Class: Machinist::DataMapper::Blueprint
- Inherits:
-
Blueprint
- Object
- Blueprint
- Machinist::DataMapper::Blueprint
- Defined in:
- lib/machinist/data_mapper/blueprint.rb
Instance Method Summary collapse
- #box(object) ⇒ Object
-
#lathe_class ⇒ Object
:nodoc:.
-
#make!(attributes = {}) ⇒ Object
Make and save an object.
- #outside_transaction ⇒ Object
- #unbox(key) ⇒ Object
Instance Method Details
#box(object) ⇒ Object
13 14 15 |
# File 'lib/machinist/data_mapper/blueprint.rb', line 13 def box(object) object.key end |
#lathe_class ⇒ Object
:nodoc:
25 26 27 |
# File 'lib/machinist/data_mapper/blueprint.rb', line 25 def lathe_class #:nodoc: Machinist::DataMapper::Lathe end |
#make!(attributes = {}) ⇒ Object
Make and save an object.
4 5 6 7 8 9 10 11 |
# File 'lib/machinist/data_mapper/blueprint.rb', line 4 def make!(attributes = {}) object = make(attributes) original_save_behaviour = object.raise_on_save_failure object.raise_on_save_failure = true object.save object.raise_on_save_failure = original_save_behaviour object.reload end |
#outside_transaction ⇒ Object
21 22 23 |
# File 'lib/machinist/data_mapper/blueprint.rb', line 21 def outside_transaction yield # FIXME: This is not actually implemented end |
#unbox(key) ⇒ Object
17 18 19 |
# File 'lib/machinist/data_mapper/blueprint.rb', line 17 def unbox(key) @klass.get(*key) end |