squeel icon indicating copy to clipboard operation
squeel copied to clipboard

Not compatible with Rails 4 count distinct

Open godfat opened this issue 11 years ago • 1 comments

Without squeel:

User.select(:username).distinct.count

Generates:

SELECT DISTINCT COUNT(DISTINCT "users"."username") FROM "users"

With squeel:

SELECT DISTINCT COUNT(DISTINCT ) FROM "users"

Which would cause syntax error. Tested with Rails 4.1.8 and pg 0.17.1 (PostgreSQL 9.3.5)

godfat avatar Dec 22 '14 11:12 godfat

This caused: https://github.com/charlotte-ruby/impressionist/issues/178

godfat avatar Dec 22 '14 11:12 godfat