[Rails] Re: Unexpected behavior with YAML

2011-01-28 Thread Marnen Laibow-Koser
Frederick Cheung wrote in post #978098: On Jan 28, 2:11am, Marnen Laibow-Koser li...@ruby-forum.com wrote: Frederick Cheung wrote in post #978021: [...] I seem to recall that historically, although method_missing etc was overriden to add dynamic methods, respond_to wasn't, which didn't

Re: [Rails] Re: Unexpected behavior with YAML

2011-01-28 Thread Philip Hallstrom
On Jan 27, 2011, at 8:28 PM, bob wrote: It seems to me like you ought to be able to call .to_yaml on a activerecord object and then use YAML.load to reconstitute it. I'm trying to figure out if something is wrong with my ruby / rails installation or if this is something that everyone

[Rails] Re: Unexpected behavior with YAML

2011-01-28 Thread bob
Thanks for verifying that Philip. Guess I'll try and dive into the code and figure out how to fix it this weekend. If anybody has any tips or ideas, let me know. On Jan 28, 12:03 pm, Philip Hallstrom phi...@pjkh.com wrote: On Jan 27, 2011, at 8:28 PM, bob wrote: It seems to me like you

[Rails] Re: Unexpected behavior with YAML

2011-01-27 Thread Marnen Laibow-Koser
bob wrote in post #977980: Hi, I'm trying to figure out why I can't dump and load a ActiveRecord object with YAML. [...] Er, why? You already have a serialized representation of it in the database...or are you trying to do some sort of backup and restore (in which case you might want to look

[Rails] Re: Unexpected behavior with YAML

2011-01-27 Thread Frederick Cheung
On Jan 27, 9:16 pm, bob larr...@gmail.com wrote: This general idea, of reconstituting a model from it's YAML representation works in some of my projects, but not in any new ones. I have no idea why this would be the case. At a guess it looks like during the yaml loading process it calls

[Rails] Re: Unexpected behavior with YAML

2011-01-27 Thread Marnen Laibow-Koser
Frederick Cheung wrote in post #978021: [...] I seem to recall that historically, although method_missing etc was overriden to add dynamic methods, respond_to wasn't, which didn't make AR a very good citizen, which may be why this works with projects using old versions of rails How is that

[Rails] Re: Unexpected behavior with YAML

2011-01-27 Thread bob
It seems to me like you ought to be able to call .to_yaml on a activerecord object and then use YAML.load to reconstitute it. I'm trying to figure out if something is wrong with my ruby / rails installation or if this is something that everyone experiences. Can anyone else verify that after

[Rails] Re: Unexpected behavior with YAML

2011-01-27 Thread Frederick Cheung
On Jan 28, 2:11 am, Marnen Laibow-Koser li...@ruby-forum.com wrote: Frederick Cheung wrote in post #978021: [...] I seem to recall that historically, although method_missing etc was overriden to add dynamic methods, respond_to wasn't, which didn't make AR a very good citizen, which