This project is archived and is in readonly mode.
[PATCH] ActiveResource not eager loading namespaced models
Reported by David Genord II | March 9th, 2009 @ 03:41 PM | in 3.x
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.
Comments and changes to this ticket
-
Pratik March 9th, 2009 @ 03:47 PM
- 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!
-
David Genord II March 9th, 2009 @ 04:05 PM
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.
-
David Genord II March 9th, 2009 @ 04:49 PM
I think I managed to create a test to demonstrate the problem. Let me know if this works.
-
Will Bryant March 11th, 2009 @ 11:16 AM
Do you know if this a regression from 2.2 or something that's never worked?
-
David Genord II June 16th, 2010 @ 09:57 PM
This appears to have never worked. Also I have updated the patch to cleanly apply against master.
-
David Genord II June 16th, 2010 @ 10:02 PM
- Title changed from ActiveResource not eager loading namespaced models to [PATCH] ActiveResource not eager loading namespaced models
-
David Genord II June 16th, 2010 @ 10:04 PM
- 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
-
David Genord II June 16th, 2010 @ 10:05 PM
- 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
-
Santiago Pastorino February 2nd, 2011 @ 04:37 PM
- 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.
-
Santiago Pastorino February 2nd, 2011 @ 04:37 PM
- State changed from open to stale
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>