I'm having problems using delayed_job (3.0.3) with ruby 1.9.3. Previously we were using ruby 1.8.7 which comes with yaml syck parser which read all the attributes that are set for a ruby object (including attr_accessors) but with the upgrade to 1.9.3 the yaml parser was switched to psych (which was re-written) and it doesn't take into account any attributes except those persisted in the database. How can we make psych to take the attr_accessors into account as well. I tried to switch to syck thru:
YAML::ENGINE.yamler = 'syck'
But still doesnt work.
Does anyone have a work around for this issue?
The above hack doesn't work but all we need is to override the encode_with and init_with methods of ActiveRecord::Base to include attribute accessors. More precisely we need to set the coder hash with the att_accessors and that takes care of instance variable persistance.
Interesting read: https://gist.github.com/3011499