I did this:
Point.all(:fields=> [:player_id], :unique=> true, :order=>[:player_id.asc]).aggregate(:player_id.count)
was trying to get : "SELECT COUNT(player_id) FROM points WHERE deleted_at IS NULL GROUP BY :player_id ORDER BY player_id"
ended up with: "SELECT COUNT("player_id") FROM "points" WHERE "deleted_at" IS NULL" in log
I did this: Point.all(:fields=> [:player_id], :unique=> true, :order=>[:player_id.asc]).aggregate(:player_id.count) was trying to get : "SELECT COUNT(player_id) FROM points WHERE deleted_at IS NULL GROUP BY :player_id ORDER BY player_id" ended up with: "SELECT COUNT("player_id") FROM "points" WHERE "deleted_at" IS NULL" in log