Re: YAML failing to de-serialize


#1

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:inload’
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