When I serialize active records I'm finding that the yaml format is different depending on which box I'm running on. On one box I get:
object: !ruby/object:User
instead of
object: !ruby/ActiveRecord:User
The first version is a problem because active support needs to do some magic to populate the active record correctly when the yaml is deserialized. What causes this difference and how can I ensure that the second format is used?
I'm using ruby 1.9.2 and I've forced the yaml engine to use syck using
require "yaml"
YAML::ENGINE.yamler = "syck"
in the boot.rb (rails app).
Update
Having dug a little further I've discovered that the ActiveRecord type isn't being registered with yaml. On the server where it works the following call:
YAML.resolver.tags.keys
includes:
"tag:ruby.yaml.org,2002:ActiveRecord"
This type is missing from the server that's behaving incorrectly. The problem now is that I have no idea why the type isn't registered.