From c7efd62fe2b5f1abc8fa1c905e0290fd71df8f85 Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Sun, 11 Dec 2016 03:25:55 -0500 Subject: [PATCH] Fix column type-detection bug in `where_object_changes` --- lib/paper_trail/version_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paper_trail/version_concern.rb b/lib/paper_trail/version_concern.rb index a73773c1..ef9b9657 100644 --- a/lib/paper_trail/version_concern.rb +++ b/lib/paper_trail/version_concern.rb @@ -171,7 +171,7 @@ module PaperTrail if columns_hash["object_changes"].type == :jsonb args.each { |field, value| args[field] = [value] } where("object_changes @> ?", args.to_json) - elsif columns_hash["object"].type == :json + elsif columns_hash["object_changes"].type == :json predicates = [] values = [] args.each do |field, value|