smerf
smerf copied to clipboard
NoMethodError for YAML::Object when validating forms
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'
Can you tell me what version of Rails you are using?
I'm using 2.3.8
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