smerf icon indicating copy to clipboard operation
smerf copied to clipboard

NoMethodError for YAML::Object when validating forms

Open jcoyne opened this issue 15 years ago • 3 comments

I hit this when trying to save a form:

NoMethodError (undefined method child_items' for #<YAML::Object:0x105b2c680>): vendor/plugins/smerf/app/models/smerf_form.rb:180:incall_validations' vendor/plugins/smerf/app/models/smerf_form.rb:174:in validate_responses' vendor/plugins/smerf/app/controllers/smerf_forms_controller.rb:138:invalidate_responses' vendor/plugins/smerf/app/controllers/smerf_forms_controller.rb:61:in `create'

jcoyne avatar Jul 16 '10 19:07 jcoyne

Can you tell me what version of Rails you are using?

springbok avatar Jul 18 '10 22:07 springbok

I'm using 2.3.8

jcoyne avatar Jul 19 '10 14:07 jcoyne

It looks like rails is having trouble finding the class definition when it is deserializing the cached object. Loading the class before deserializing i.e. adding

require 'smerf_meta_form'

in smerf_form.rb seems to fix the issue

subhash avatar Mar 09 '11 10:03 subhash