--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: If you have an attribute that needs to be saved to the database as an object, and retrieved as the same object, then specify the name of that attribute using this method and it will be handled automatically. The serialization is done through YAML. If <tt>class_name</tt> is specified, the serialized object must be of that class on retrieval or SerializationTypeMismatch will be raised.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Parameters
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>attr_name</tt> - The field name that should be serialized.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>class_name</tt> - Optional, class name that the object type should be equal to.
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Example
- !ruby/struct:SM::Flow::VERB 
  body: "  # Serialize a preferences attribute\n  class User\n    serialize :preferences\n  end\n"
full_name: ActiveRecord::Base::serialize
is_singleton: true
name: serialize
params: (attr_name, class_name = Object)
visibility: public
