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.

Association preload include chain stops if it hits a nil object

#1630

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.

Reported by Joseph Palermo · December 24th, 2008 @ 11:09 PM

State: resolved
Milestone: 2.x
Assigned to: Frederick Cheung Frederick Cheung
Importance: none

Activity

  1. Frederick Cheung
    Frederick Cheung
    • Assigned user set to Frederick Cheung

    Look's good to me

    December 25th, 2008 @ 12:19 AM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [eb457ceee13779ade67e1bdebd2919d476148277]) Association preloading no longer stops if it hits a nil object [#1630 Association preload include chain stops if it hits a nil object state:resolved]

    Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...

    December 26th, 2008 @ 09:57 PM