rails/rails — Issue #4758: Regression with default_scope, relation_ids and PG
Author: oriolgual
Created: 2012-01-30 12:13:05+00:00
State: open

Hi,

After updating my app from 3.1.3 to 3.2.1 I've encountered an issue:

`ActiveRecord::StatementInvalid: PGError: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ... "students" WHERE "students"."subject_id" = 1 ORDER BY name`

I've created this gist on how to reproduce the bug: https://gist.github.com/1704071

Could this be related to #4738?

I've also tried with the 3-2-stable branch and this is still happening.