Skip to content

Commit

Permalink
Adjust README section for serializers to show full namespace of built…
Browse files Browse the repository at this point in the history
…-in modules [ci skip]
  • Loading branch information
batter committed Sep 23, 2014
1 parent 433a5d7 commit 00b3097
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/paper_trail/has_paper_trail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def serialize_attributes_for_paper_trail(attributes)

serialized_attributes.each do |key, coder|
if attributes.key?(key)
coder = PaperTrail.serializer unless coder.respond_to?(:dump) # Fall back to current serializer if `coder` has no `dump` method
# Fall back to current serializer if `coder` has no `dump` method
coder = PaperTrail.serializer unless coder.respond_to?(:dump)
attributes[key] = coder.dump(attributes[key])
end
end
Expand All @@ -140,7 +141,8 @@ def serialize_attribute_changes(changes)

serialized_attributes.each do |key, coder|
if changes.key?(key)
coder = PaperTrail.serializer unless coder.respond_to?(:dump) # Fall back to current serializer if `coder` has no `dump` method
# Fall back to current serializer if `coder` has no `dump` method
coder = PaperTrail.serializer unless coder.respond_to?(:dump)
old_value, new_value = changes[key]
changes[key] = [coder.dump(old_value),
coder.dump(new_value)]
Expand Down

0 comments on commit 00b3097

Please sign in to comment.