Exception: Petra::WriteClashError
- Inherits:
-
ValueComparisonError
- Object
- StandardError
- PetraError
- ExtendedError
- HandlerException
- ValueComparisonError
- Petra::WriteClashError
- Defined in:
- lib/petra/exceptions.rb
Overview
Thrown when an attribute that we previously read AND changed was also changed externally.
Instance Attribute Summary collapse
-
#our_value ⇒ Object
readonly
Returns the value of attribute our_value.
Attributes inherited from ValueComparisonError
#attribute, #external_value, #object
Instance Method Summary collapse
-
#undo_changes! ⇒ Object
(also: #use_theirs!)
Tells the transaction to ignore all changes previously done to the current attribute in the transaction.
Methods inherited from ValueComparisonError
Methods inherited from HandlerException
#continuable?, #continue!, #reset_transaction!, #retry!, #rollback_transaction!
Methods inherited from ExtendedError
Constructor Details
This class inherits a constructor from Petra::ExtendedError
Instance Attribute Details
#our_value ⇒ Object (readonly)
Returns the value of attribute our_value.
121 122 123 |
# File 'lib/petra/exceptions.rb', line 121 def our_value @our_value end |
Instance Method Details
#undo_changes! ⇒ Object Also known as: use_theirs!
Tells the transaction to ignore all changes previously done to the current attribute in the transaction.
127 128 129 130 131 |
# File 'lib/petra/exceptions.rb', line 127 def undo_changes! Petra.current_transaction.current_section.log_attribute_change_veto(object, attribute: attribute, external_value: external_value) end |