
resources fail to load associations after _dump/_load
Reported by geemus (Wesley Beary) | January 5th, 2009 @ 06:58 PM
Resources with working associations fail to load their associations after they have been dumped/loaded. With an error akin to:
/Library/Ruby/Gems/1.8/gems/dm-core-0.9.9/lib/dm-core/associations/relationship.rb:106:in
send': undefined method
animals_association' for
nil:NilClass (NoMethodError)
It would appear (to me) to be an error with the identity map on the repository of the resources after _load (which is an empty hash). This would appear to cause issues with child_key and parent_key lookups. The attached stand-alone script demonstrates the problem (and difference in repository identity_maps).
Comments and changes to this ticket
-
Dan Kubb (dkubb) January 7th, 2009 @ 04:21 PM
- State changed from unconfirmed to accepted
-
Dan Kubb (dkubb) February 23rd, 2009 @ 03:37 PM
- State changed from accepted to hold
@Wesley: I can't seem to reproduce this with dm-core/next.
When I run your script it appears to have an error in it, but I don't know what your intentions are, and rather than assume them I wondered if you could try to reproduce this with dm-core/next and attach a stand-alone script if you can.
-
geemus (Wesley Beary) February 28th, 2009 @ 02:38 PM
I've update it to get back to meaningful errors. My intention was to dump an object which had associations on it, and then load the dump and have the associations still work. Currently I'm running in to the fact that _dump is not defined, and Marshal.dump fails when trying to dump a Proc.
marshaled_associations.rb:38:in
dump': no marshal_dump is defined for class Proc (TypeError)
Let me know if I can be more explanatory or help out more than that.
-
Yngwie Manskraut April 3rd, 2009 @ 12:29 AM
I also experienced this issue.
And can reproduce it with the latest script from geemus, after uncommenting a line...
Fri, 03 Apr 2009 05:27:30 GMT ~ debug ~ (0.000032) SELECT "id", "name", "zoo_id" FROM "animals" WHERE ("zoo_id" IN (1)) ORDER BY "id" /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/associations/relationship.rb:106:in
send': undefined method
animals_association' for nil:NilClass (NoMethodError) -
Dan Kubb (dkubb) June 16th, 2009 @ 03:21 AM
- Milestone set to 0.10.1
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.1 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" not-tagged:"0.10.1" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM
- Milestone changed from 0.10.2 to 1.0.0
-
-
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 »