Skip to content

Commit

Permalink
distinct is broken with squeel, need to write SQL directly
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Dec 22, 2014
1 parent 569f0ee commit 0a6cdeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/impressionist/impressionable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def impressionist_count(options={})
# Count all distinct impressions unless the :all filter is provided.
distinct = options[:filter] != :all
if Rails::VERSION::MAJOR == 4
distinct ? imps.distinct.count(options[:filter]) : imps.count
distinct ? imps.count("DISTINCT #{self.class.connection.quote_column_name(options[:filter])}") : imps.count
else
distinct ? imps.count(options[:filter], :distinct => true) : imps.count
end
Expand Down

0 comments on commit 0a6cdeb

Please # to comment.