If I change @original_attributes ||= {} to @original_attributes || {}
in lib/dm-core/resource.rb, I no longer get this error - so it is
definitly the problem that somehow @original_attributes is getting
frozen.

I cannot find anywhere in dm-core that would cause this. Does anyone
more familiar with this know why this would happen?

For now, I am going with that small change which should be fine
(should), but I don't like the idea that the instance variable is
being frozen when I don't see a #freeze method happening anywhere near
there. I might have to override the freeze method and log when it is
used or something.

On Oct 17, 10:37 am, myobie <myo...@gmail.com> wrote:
> I am actually getting the same error I think, mine reads exactly:
>
> TypeError: can't modify frozen object
> from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.1/lib/dm-core/
> resource.rb:491:in `original_attributes'
>
> I think it's just where @original_atrrigutes ||= {}, but somehow that
> instance variable is already frozen?
> I'm not sure what's going on.
>
> Either way, this is very strange to me, here is a gist of my adapter
> where I am just passing back a hash:http://gist.github.com/212354
>
> I don't get how that is giving me an error at all, since there is very
> little code.
>
> On Oct 17, 3:05 am, Nicholas Orr <nicholas....@zxgen.net> wrote:
>
>
>
> > All I know is this error is giving me the shits...I've upgraded from 0.9 to
> > 0.10.1 and all the errors I keep running into are "can't modify frozen
> > object - (TypeError)"
> > ok it's a little bit different - back to updating code :)
>
> > On Sat, Oct 17, 2009 at 3:09 PM, myobie <myo...@gmail.com> wrote:
>
> > > I am trying to make a simple adapter, but when I do
> > > query.filter_records() on my array of hashes, I keep getting this
> > > error. It's strange, since I know I have a :key => true on one
> > > property, so I know it has a primary key.
>
> > > Anyone see this before?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamapper@googlegroups.com
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to