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:
parent
d904af21e3
commit
bd3946c87b
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue