Forum: Ruby on Rails Re: YAML failing to de-serialize

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
01457d1a0f0e533062cd0d1033fb4d7a?d=identicon&s=25 kellan (Guest)
on 2006-05-03 19:00
(Received via mailing list)
I'm seeing this same problem that Josh was seeing back on March 23rd
(see below)

I've got the following YAML snippet stored in a text field:

"--- !ruby/object:FieldValue \nattributes: \n  item_id: 60\n  title:
Test\n  field_id: 15\n  created_by_id: 5\n  locale: en\n  link:
www.cclearn.com\n  comment: this is a test\n  created_at: 2006-05-02
15:43:14.256792 Z\nnew_record: true\n"

When deserialize this using YAML.load and the FieldValue class is not
loaded I successfully get a YAML::Object.

However is FieldValue is loaded I get an error:

NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1402:in
`respond_to?'
        from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
        from (irb):34

This is with Rails 1.0

In my case I didn't migrate from 1.8.2 to 1.8.4, but developed under
1.8.2 and am now trying to deploy under 1.8.4 (not the best idea I
acknowledged)

Any help?

Thanks
-kellan
This topic is locked and can not be replied to.