1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Adjust PaperTrail::Serializers::YAML#where_object_changes

to handle inconsistencies with spacing between values in YAML dumps of Arrays
This commit is contained in:
Ben Atkins 2015-01-14 14:53:45 -05:00
parent d904af21e3
commit bd3946c87b

View file

@ -25,10 +25,10 @@ module PaperTrail
# Need to check first (before) and secondary (after) fields
if defined?(::YAML::ENGINE) && ::YAML::ENGINE.yamler == 'psych'
arel_field.matches("%\n#{field}:\n- #{value}\n%").
or(arel_field.matches("%\n#{field}:\n- %\n- #{value}\n%"))
or(arel_field.matches("%\n#{field}:\n-%\n- #{value}\n%"))
else # Syck adds extra spaces into array dumps
arel_field.matches("%\n#{field}: \n- #{value}\n%").
or(arel_field.matches("%\n#{field}: \n- %\n- #{value}\n%"))
or(arel_field.matches("%\n#{field}: \n-%\n- #{value}\n%"))
end
end
end