Class: Machinist::ActiveRecord::Blueprint
- Defined in:
- lib/machinist/active_record/blueprint.rb
Instance Attribute Summary
Attributes inherited from Blueprint
Instance Method Summary collapse
-
#lathe_class ⇒ Object
:nodoc:.
-
#make!(attributes = {}) ⇒ Object
Make and save an object.
Methods inherited from Blueprint
#each_ancestor, #initialize, #make, #parent_blueprint
Constructor Details
This class inherits a constructor from Machinist::Blueprint
Instance Method Details
#lathe_class ⇒ Object
:nodoc:
14 15 16 |
# File 'lib/machinist/active_record/blueprint.rb', line 14 def lathe_class #:nodoc: Machinist::ActiveRecord::Lathe end |
#make!(attributes = {}) ⇒ Object
Make and save an object.
5 6 7 8 9 10 11 12 |
# File 'lib/machinist/active_record/blueprint.rb', line 5 def make!(attributes = {}) object = make(attributes) object.save! object.reload rescue ::ActiveRecord::RecordInvalid => exception = "#{exception.class.name}: \"#{exception.}\" saving #{exception.record.class.name}" raise Machinist::BlueprintCantSaveError.new(self, ) end |