# Deserializing objects in the controller

**URL:** <https://www.ruby-forum.com/t/deserializing-objects-in-the-controller/111082>\
**Category:** Rails\
**Created:** [August 2, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/deserializing-objects-in-the-controller/111082 "2007-08-02T13:21:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 2, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/deserializing-objects-in-the-controller/111082/1 "2007-08-02T13:21:45Z")

</div>

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  
messages.

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