From 450f04dd66941d02e5fbdf8ee41f9fe3ef7a6792 Mon Sep 17 00:00:00 2001 From: Paul Chobert Date: Mon, 28 Oct 2013 19:05:04 +0100 Subject: [PATCH] Fix Mongoid filter error ```NameError: undefined local variable or method `filter'``` --- .../models/mongoid/impressionist/impressionable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/impressionist/models/mongoid/impressionist/impressionable.rb b/lib/impressionist/models/mongoid/impressionist/impressionable.rb index d770a79..4311d3b 100644 --- a/lib/impressionist/models/mongoid/impressionist/impressionable.rb +++ b/lib/impressionist/models/mongoid/impressionist/impressionable.rb @@ -18,7 +18,7 @@ module Impressionist # Count all distinct impressions unless the :all filter is provided distinct = options[:filter] != :all - distinct ? imps.where(filter.ne => nil).distinct(filter).count : imps.count + distinct ? imps.where(options[:filter].ne => nil).distinct(options[:filter]).count : imps.count end end