Deserializing objects in the controller

I’ve an AR model that serializes another object (A), which does not
inherit from ActiveRecord::Base. The problem I’m facing is that while
A can be deserialized properly in script/console, it deserializes as
YAML::Object in the controller. This means that the methods on A are
not available on the deserialized instance and I receive NoMethodError

I’ve tried to use YAML to manually perform serialization/
deserialization but the problem doesn’t go away.