Skip to content

Commit

Permalink
Fix presence of ignored fields in history
Browse files Browse the repository at this point in the history
Closes #1576
  • Loading branch information
yulgolem committed Apr 30, 2020
1 parent 8b6a615 commit c4e4614
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/concerns/versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def all_versions_for(ids, time)
valid_columns = ver.item_type.constantize&.column_names
o = new(ver.object&.slice(*valid_columns))
o.version_loader = ver
ver.object_changes.to_h.each { |k, v| o.public_send("#{k}=", v[-1]) }
changes = ver.object_changes.to_h&.slice(*valid_columns)
changes.each { |k, v| o.public_send("#{k}=", v[-1]) }
o
end
not_in_history = where(id: (ids.to_a - from_history.map(&:id)))
Expand Down

0 comments on commit c4e4614

Please sign in to comment.