I understand that the "group_by" selector is understood differently by mySQL and PostgreSQL, thanks to questions posted here. However, try as I might, I can't get the following (seemingly) simple query to work with the Heroku (PostgreSQL) db, while it works fine in my development mySQL environment:
@trans_by_trip = @user.transactions.order("date").sum(:amount_cents, :group => :trip_id)
I read that by including a calculation like "sum," group_by would work, but it doesn't. And I must admit that I'm at a loss to translate the query into raw SQL.
Many thanks for any help.