Class: PaperTrail::AttributeSerializers::ObjectAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/paper_trail/attribute_serializers/object_attribute.rb

Overview

Serialize or deserialize the ‘version.object` column.

Instance Method Summary collapse

Constructor Details

#initialize(model_class) ⇒ ObjectAttribute

Returns a new instance of ObjectAttribute.



9
10
11
# File 'lib/paper_trail/attribute_serializers/object_attribute.rb', line 9

def initialize(model_class)
  @model_class = model_class
end

Instance Method Details

#deserialize(attributes) ⇒ Object



17
18
19
# File 'lib/paper_trail/attribute_serializers/object_attribute.rb', line 17

def deserialize(attributes)
  alter(attributes, :deserialize)
end

#serialize(attributes) ⇒ Object



13
14
15
# File 'lib/paper_trail/attribute_serializers/object_attribute.rb', line 13

def serialize(attributes)
  alter(attributes, :serialize)
end