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.

[PATCH] ActiveResource not eager loading namespaced models

#2179

Namespaced models are not eager loaded when loading association data in ActiveResource.

For example say you have models Accounts::User and Accounts::Address, and when you perform a find of the user, it also returns the user's addresses. if Accounts::Address is not loaded ActiveResource will create the class Accounts::User::Address instead of eager loading Accounts::Address when loading the data for the addresses.

I have created a patch here http://github.com/xspond/rails/c... but I do not know how to create the tests for this issue.

Reported by David Genord II · March 9th, 2009 @ 03:41 PM

State: stale
Milestone: 3.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • Assigned user set to Pratik
    • State changed from new to incomplete

    Could you please upload a patch using git-format-patch ? http://guides.rails.info/contrib... should help.

    Also, your patch seems to be missing the tests.

    Thanks!

    March 9th, 2009 @ 03:47 PM

  2. David Genord II
    David Genord II

    I have added the patch file and as I said above I have not included tests because I have no idea how to test eager loading. I could not find any examples in the ActiveResource tests. If you could point out some examples I would be glad to write the tests.

    March 9th, 2009 @ 04:05 PM

  3. David Genord II
    David Genord II

    I think I managed to create a test to demonstrate the problem. Let me know if this works.

    March 9th, 2009 @ 04:49 PM

  4. Will Bryant
    Will Bryant

    Do you know if this a regression from 2.2 or something that's never worked?

    March 11th, 2009 @ 11:16 AM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  6. David Genord II
    David Genord II

    This appears to have never worked. Also I have updated the patch to cleanly apply against master.

    June 16th, 2010 @ 09:57 PM

  7. David Genord II
    David Genord II
    • Title changed from ActiveResource not eager loading namespaced models to [PATCH] ActiveResource not eager loading namespaced models

    June 16th, 2010 @ 10:02 PM

  8. David Genord II
    David Genord II
    • Tag changed from 2.3, 2.3-rc1, 2.3-rc2, 2.3.0, active_resource, eagerloading, eager_loading to 2.3, 2.3-rc1, 2.3-rc2, 2.3.0, active_resource, eagerloading, eager_loading, patch

    June 16th, 2010 @ 10:04 PM

  9. David Genord II
    David Genord II
    • Tag changed from 2.3, 2.3-rc1, 2.3-rc2, 2.3.0, active_resource, eagerloading, eager_loading, patch to 3.x, active_resource, eagerloading, eager_loading, patch

    June 16th, 2010 @ 10:05 PM

  10. Santiago Pastorino
    Santiago Pastorino
    • State changed from incomplete to open
    • Tag changed from 3.x, active_resource, eagerloading, eager_loading, patch to 3x, active_resource, eagerloading, eager_loading, patch
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:37 PM

  11. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:37 PM