1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

MySQL quotes with ``, not ""

This commit is contained in:
Akira Matsuda 2017-06-03 05:55:10 +09:00
parent 7f997c7f42
commit 93136e02fe

View file

@ -16,7 +16,7 @@ class User < ActiveRecord::Base
cols = if connection.adapter_name == "PostgreSQL"
column_names.map { |column| %{"users"."#{column}"} }
else
['"users"."id"']
['users.id']
end
group(*cols).select("count(readerships.id) AS read_count, #{cols.join(', ')}").order('read_count DESC')
}