Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

allow reorder to affect eager loading correctly #4216

Merged
merged 1 commit into from Dec 29, 2011

Conversation

Projects
None yet
2 participants
Contributor

al2o3cr commented Dec 28, 2011

(master-based version of #4082)

Calling last on an association that's scoped with reorder can cause some adapters to fail (particularly oracle_enhanced and postgres). The underlying cause is that connection.distinct expects the desired order, but the relation's reorder_values are not passed along, since construct_limited_ids explicitly grabs order_values.

See the attached commit for additional details - this bug does not affect the mysql or sqlite adapters, as those use the default order-agnostic implementation of distinct.

tenderlove added a commit that referenced this pull request Dec 29, 2011

Merge pull request #4216 from edgecase/master_fix_reorder_with_limite…
…d_ids

allow reorder to affect eager loading correctly

@tenderlove tenderlove merged commit 780a222 into rails:master Dec 29, 2011

tenderlove added a commit that referenced this pull request Dec 29, 2011

Merge pull request #4216 from edgecase/master_fix_reorder_with_limite…
…d_ids

allow reorder to affect eager loading correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment