rails/rails — pull request #15034 by garymardell (2014-05-09 00:16:01+00:00)
Title: Remove order when fetching association ids.

Removes the order from the relation when fetching the association ids. This prevents an exception that database throws when ordering by a column that no longer exists.

Eg.

```
Author.includes(:posts).
select('`authors`.*, LOWER(`authors`.`name`) as `lower_name`').
order('`lower_name`').
limit(5)
```