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.
52 53 54 55 56 |
# File 'lib/statecraft/errors.rb', line 52 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.
50 51 52 |
# File 'lib/statecraft/errors.rb', line 50 def record @record end |