Error with Ruby 1.9.2 - Can't add a new key into hash during iteration
Reported by Michael MacDonald | October 11th, 2010 @ 01:15 AM
Hi Ian,
Running Pickle with Ruby 1.9.2 and I encountered this error:
can't add a new key into hash during iteration (RuntimeError)
/Users/michaelm/.rvm/gems/ruby-1.9.2-p0/gems/pickle-0.3.5/lib/pickle/session.rb:164:in `[]='
Initially it was with pickle 0.3.5 but it still exists with version 0.4.2. It occurs when I'm using an association (in Session#convert_models_to_attributes) eg:
Then a placement should exist with registration: the registration
Apparently it is a bug/feature with Ruby 1.9.2. I mimicked another person's workaround and it worked, see: http://github.com/remvee/exifr/commit/597f935cb2c251fd2792101fcaf99...
I can submit this change if you want but I wasn't sure whether this method/approach will still be in the new pickle changes you're making.
Cheers,
Michael.
Comments and changes to this ticket
-
Ian White October 11th, 2010 @ 04:23 PM
Hey Michael,
Thanks for the heads up. New pickle will use orm_adapter for this stuff, and should be out soon, so I'll make sure that a test goes in for this issue.
Cheers,
Ian -
Ben Hutton November 3rd, 2010 @ 05:48 PM
Also hitting this. Any ETA on the fix? Or should I try to hack around it?
-
Ian White November 4th, 2010 @ 08:13 AM
Arg, thanks for the nudge. Been busy with life and work. This has been fixed in orm_adapter, but I haven't got pickle using orm_adapter yet.
I'll port the fix to pickle right now.
-
Ian White November 4th, 2010 @ 08:31 AM
- State changed from new to resolved
(from [3e8df198db1121f3694b4ae2f04153ebc8e4ce1f]) Backport ruby 1.9.2 compat fix from orm_adapter [#33 state:resolved] https://github.com/ianwhite/pickle/commit/3e8df198db1121f3694b4ae2f...
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 ยป
Assign tickets to <b>Ian White</b>, so I get notified
People watching this ticket
Tags
Referenced by
- 33 Error with Ruby 1.9.2 - Can't add a new key into hash during iteration (from [3e8df198db1121f3694b4ae2f04153ebc8e4ce1f]) Backpor...