
[PATCH] Fix lazy loading bugs with STI collection
Reported by contagion | October 14th, 2008 @ 10:14 AM
When fetching STI objects through parent model, lazy loading will clear up objects' properties in the collection.
When models want to load lazy properties, it will only query the lazy properties and the key properties from repository, and get the other properties from identity map.
However, the inheritance property, which is not in the query, is crucial for STI model because Model#load will use it to find the correct identity map. Without the inheritance property, model cannot fetch the object from identity map, thus cause the object properties be set to nil.
Comments and changes to this ticket
-
Dan Kubb (dkubb) December 1st, 2008 @ 02:26 AM
- Assigned user changed from Sam Smoot to Dan Kubb (dkubb)
- State changed from new to open
-
Dan Kubb (dkubb) December 4th, 2008 @ 03:55 AM
- State changed from open to accepted
-
Dan Kubb (dkubb) May 16th, 2009 @ 01:20 AM
- State changed from accepted to resolved
I have updated dm-core/next to explicitly include the discriminator field when reloading a resource.
I am marking this as resolved for now, but if you test the dm-core/next branch and find this does not work for you please comment in this ticket and I will re-open it.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »