From c69437bfff9c244ad9dcd38c84d120f5a94b642e Mon Sep 17 00:00:00 2001 From: zonkeynir Date: Mon, 28 Apr 2014 17:50:14 +0300 Subject: [PATCH] Issue for mongoid Queries is always on ObjectId type of imperssion_id, while model not restricts the type. Thats can cause to saves in String format, hence not imperssions will be counted on counter_cache --- lib/impressionist/models/mongoid/impression.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/impressionist/models/mongoid/impression.rb b/lib/impressionist/models/mongoid/impression.rb index d3b1c15..01e8524 100644 --- a/lib/impressionist/models/mongoid/impression.rb +++ b/lib/impressionist/models/mongoid/impression.rb @@ -8,7 +8,7 @@ class Impression include Impressionist::CounterCache Impressionist::SetupAssociation.new(self).set - field :impressionable_id + field :impressionable_id, type: BSON::ObjectId field :impressionable_type field :user_id field :controller_name