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

Fix column type-detection bug in where_object_changes

This commit is contained in:
Jared Beck 2016-12-11 03:25:55 -05:00
parent cf00b27940
commit c7efd62fe2

View file

@ -171,7 +171,7 @@ module PaperTrail
if columns_hash["object_changes"].type == :jsonb if columns_hash["object_changes"].type == :jsonb
args.each { |field, value| args[field] = [value] } args.each { |field, value| args[field] = [value] }
where("object_changes @> ?", args.to_json) where("object_changes @> ?", args.to_json)
elsif columns_hash["object"].type == :json elsif columns_hash["object_changes"].type == :json
predicates = [] predicates = []
values = [] values = []
args.each do |field, value| args.each do |field, value|