This project is archived and is in readonly mode.
chaining two scopes with :includes, drops the second :includes
Reported by Sean | August 3rd, 2010 @ 03:18 PM | in 3.x
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).
Comments and changes to this ticket
-
Neeraj Singh August 4th, 2010 @ 01:51 AM
- 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.
-
Neeraj Singh August 4th, 2010 @ 05:04 AM
- Assigned user changed from Neeraj Singh to José Valim
Attached is patch with test.
-
Repository August 14th, 2010 @ 12:23 PM
- State changed from open to resolved
(from [8fdecaaef210355cb21da08daa44487549888bbf]) Ensure we can nest include calls [#5285 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/8fdecaaef210355cb21da08daa4448...
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
- 5285 chaining two scopes with :includes, drops the second :includes (from [8fdecaaef210355cb21da08daa44487549888bbf]) Ensure ...