Exception: Statecraft::UnsavedRecordError
- Defined in:
- lib/statecraft/errors.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record:) ⇒ UnsavedRecordError
constructor
A new instance of UnsavedRecordError.
Constructor Details
#initialize(record:) ⇒ UnsavedRecordError
Returns a new instance of UnsavedRecordError.
74 75 76 77 78 |
# File 'lib/statecraft/errors.rb', line 74 def initialize(record:) @record = record super("cannot transition an unsaved #{record.class.name}: save the record first; " \ "initial state comes from the column default") end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
72 73 74 |
# File 'lib/statecraft/errors.rb', line 72 def record @record end |