Why do I get this error when I try to deserialize a new ActiveRecord object:
[Dev]> YAML.load(Identity.new.to_yaml)
Delayed::DeserializationError: Delayed::DeserializationError
while at the same time, this example with an existing AR object works as expected:
[Dev]> YAML.load(Identity.first.to_yaml)
=> #<Identity id: 1, ...
A few things that seem relevant, based on searching for answers:
I'm using ruby 1.9.2p318
, rails 3.1.3
, delayed_job 2.1.4
and my YAML::ENGINE.yamler
is syck
.
What can I do so that I can serialize a new Identity record as YAML and then deserialize it later?
UPDATE: I also discovered that if I remove the delayed_job
gem then this simple example does work, and my YAML::ENGINE.yamler
is now psych
. But I use delayed_job
in my app, so it's still important to understand what's going on