Class: PaperTrail::RelatedChanges::Serializer::BuildDiffs

Inherits:
Object
  • Object
show all
Defined in:
lib/paper_trail/related_changes/serializer.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr, diff, record, request_type, change) ⇒ BuildDiffs

Returns a new instance of BuildDiffs.



72
73
74
75
76
77
78
# File 'lib/paper_trail/related_changes/serializer.rb', line 72

def initialize(attr, diff, record, request_type, change)
  @attr         = attr.to_sym
  @diff         = diff
  @record       = record
  @request_type = request_type
  @change       = change
end

Instance Method Details

#callObject



80
81
82
83
84
# File 'lib/paper_trail/related_changes/serializer.rb', line 80

def call
  return call_serializer if custom_serializer

  change.diffs << default_diff
end