Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Using conditions/order on a join table will break on a limited eager loading

#372

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.

Reported by Tiago Macedo · June 8th, 2008 @ 05:13 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Tiago Macedo
    Tiago Macedo

    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).

    June 8th, 2008 @ 05:15 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [a2f6ded73209eeb9c6843b16c0253bbe56236b29]) Fix conditions and order on join tables with limited eager loading. [#372 state:resolved]

    http://github.com/rails/rails/co...

    June 8th, 2008 @ 09:02 PM

  3. Repository
    Repository

    (from [0aedc7aa96772ede7fd39fbd513c3a019fe9eb18]) Fix conditions and order on join tables with limited eager loading. [#372 state:resolved]

    http://github.com/rails/rails/co...

    June 8th, 2008 @ 09:04 PM