Class: PaperTrail::AttributeSerializers::ObjectChangesAttribute
- Inherits:
-
Object
- Object
- PaperTrail::AttributeSerializers::ObjectChangesAttribute
- Defined in:
- lib/paper_trail/attribute_serializers/object_changes_attribute.rb
Overview
Serialize or deserialize the ‘version.object_changes` column.
Instance Method Summary collapse
- #deserialize(changes) ⇒ Object
-
#initialize(item_class) ⇒ ObjectChangesAttribute
constructor
A new instance of ObjectChangesAttribute.
- #serialize(changes) ⇒ Object
Constructor Details
#initialize(item_class) ⇒ ObjectChangesAttribute
Returns a new instance of ObjectChangesAttribute.
9 10 11 |
# File 'lib/paper_trail/attribute_serializers/object_changes_attribute.rb', line 9 def initialize(item_class) @item_class = item_class end |
Instance Method Details
#deserialize(changes) ⇒ Object
17 18 19 |
# File 'lib/paper_trail/attribute_serializers/object_changes_attribute.rb', line 17 def deserialize(changes) alter(changes, :deserialize) end |
#serialize(changes) ⇒ Object
13 14 15 |
# File 'lib/paper_trail/attribute_serializers/object_changes_attribute.rb', line 13 def serialize(changes) alter(changes, :serialize) end |