app/models/impressionist/impressionable.rb in impressionist-1.5.1 vs app/models/impressionist/impressionable.rb in impressionist-1.5.2
- old
+ new
@@ -39,10 +39,10 @@
imps = imps.where("impressions.message = ?", options[:message])
end
# Count all distinct impressions unless the :all filter is provided.
distinct = options[:filter] != :all
- if Rails::VERSION::MAJOR == 4
+ if Rails::VERSION::MAJOR >= 4
distinct ? imps.select(options[:filter]).distinct.count : imps.count
else
distinct ? imps.count(options[:filter], :distinct => true) : imps.count
end
end