Exception: Statecraft::DirtyRecordError
- Defined in:
- lib/statecraft/errors.rb
Instance Attribute Summary collapse
-
#changed_attributes ⇒ Object
readonly
Returns the value of attribute changed_attributes.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record:, changed_attributes:) ⇒ DirtyRecordError
constructor
A new instance of DirtyRecordError.
Constructor Details
#initialize(record:, changed_attributes:) ⇒ DirtyRecordError
Returns a new instance of DirtyRecordError.
84 85 86 87 88 89 |
# File 'lib/statecraft/errors.rb', line 84 def initialize(record:, changed_attributes:) @record = record @changed_attributes = changed_attributes super("cannot lock-transition #{record.class.name}##{record.id} with unsaved changes " \ "(#{changed_attributes.join(", ")}): save or reload before transitioning") end |
Instance Attribute Details
#changed_attributes ⇒ Object (readonly)
Returns the value of attribute changed_attributes.
82 83 84 |
# File 'lib/statecraft/errors.rb', line 82 def changed_attributes @changed_attributes end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
82 83 84 |
# File 'lib/statecraft/errors.rb', line 82 def record @record end |