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.

chaining two scopes with :includes, drops the second :includes

#5285

Maybe I'm doing something wrong, but it seems that when chaining scopes that each have an :includes on different tables, that only the first include is converted into a join in the generated SQL; the :include from the second scope is ignored. The scopes both work fine on their own, but fail when combined (since the second join is missing). I've tested it several different ways, and I'm led to believe that there may be a bug.

Full example here:

http://stackoverflow.com/questions/3393013/problem-activerecord-rai...

(running rails 3.0.0.beta4).

Reported by Sean · August 3rd, 2010 @ 03:18 PM

State: resolved
Milestone: 3.x
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh
    • Milestone set to 3.x
    • State changed from new to open
    • Assigned user set to Neeraj Singh
    • Importance changed from to Low

    working on this one.

    August 4th, 2010 @ 01:51 AM

  2. Neeraj Singh
    Neeraj Singh
    • Assigned user changed from Neeraj Singh to José Valim

    Attached is patch with test.

    August 4th, 2010 @ 05:04 AM

  3. Repository