This project is archived and is in readonly mode.
Using conditions/order on a join table will break on a limited eager loading
Reported by Tiago Macedo | June 8th, 2008 @ 05:13 PM
This patch solves the problem that currently exists when using conditions or order on a join table.
This should only affect the limited eager loadds, which means that in order to verify this, you need a has_and_belongs_to_many relationship and you need to use the :limit, :include and :conditions (or :order) on a column that belongs to the join table.
Included in the patch are tests that verify this.
Comments and changes to this ticket
-
Tiago Macedo June 8th, 2008 @ 05:15 PM
This achived by adding a second check to the joins_for_table_name method. Instead of just checking for references to the table name, it also checks for references to the aliased_join_table_name (only if the first doesn't return anything).
-
Repository June 8th, 2008 @ 09:02 PM
- State changed from new to resolved
(from [a2f6ded73209eeb9c6843b16c0253bbe56236b29]) Fix conditions and order on join tables with limited eager loading. [#372 state:resolved]
-
Repository June 8th, 2008 @ 09:04 PM
(from [0aedc7aa96772ede7fd39fbd513c3a019fe9eb18]) Fix conditions and order on join tables with limited eager loading. [#372 state:resolved]
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 258 Eager loading optimisation misses if order specified I've created a test for this particular case and it pass...