This project is archived and is in readonly mode.
Association preload include chain stops if it hits a nil object
Reported by Joseph Palermo | December 24th, 2008 @ 11:09 PM | in 2.x
If you have a singular association that is not guaranteed to be populated, when trying to include past that the preloading stops if the first returned value was nil.
For example: user has_one lunch lunch has_many tasty_snacks
User.find(:all, :include => {:lunch => :tasty_snacks})
If the first user returned from the find does NOT have a lunch, tasty_snacks are not loaded for any of the users, even if they have lunches.
Comments and changes to this ticket
-
Frederick Cheung December 25th, 2008 @ 12:19 AM
- Assigned user set to Frederick Cheung
Look's good to me
-
Repository December 26th, 2008 @ 09:57 PM
- State changed from new to resolved
(from [eb457ceee13779ade67e1bdebd2919d476148277]) Association preloading no longer stops if it hits a nil object [#1630 state:resolved]
Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...
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
Referenced by
- 1630 Association preload include chain stops if it hits a nil object (from [eb457ceee13779ade67e1bdebd2919d476148277]) Associa...