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.

Add :preload option to find

#3683

This patch adds support for a :preload option, which functions much like the "new" :include path - but it will always use that rather than falling back to the old join-based :include path if the query options reference other tables.

Thus, it makes it possible to preload polymorphic associations even if you have some table conditions, other joins, or a multi-table :select option, and ensures you don't get O(n^m|m = number of loaded tables) resultsets in these conditions. It supports using both :include and :preload in one find, which is quite useful if you want to include to restrict the resultset but preload to efficiently load associations.

This should enable us to pass the bitter, cold evenings until 3.0 brings new association love.

Reported by Will Bryant · January 11th, 2010 @ 10:40 AM

State: stale
Milestone: none
Assigned to: Michael Koziarski Michael Koziarski
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to Low

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    October 9th, 2010 @ 03:16 AM

  2. Will Bryant
    Will Bryant

    It is still an issue on 2-3-stable. The patch does contain tests. It still applies cleanly to 2-3-stable.

    (master doesn't need this though.)

    December 9th, 2010 @ 09:52 AM

  3. Rohit Arondekar
    Rohit Arondekar

    Thank you for responding Will. Unfortunately this patch changes the user facing API. Since 2.3 is only being supported for bug fixes this patch cannot be applied any longer.

    December 9th, 2010 @ 10:11 AM

  4. Will Bryant
    Will Bryant

    Fair enough. The patch is still here for people who want to apply it, so we can close this ticket.

    December 9th, 2010 @ 10:54 AM

  5. gfh