Skip to content

Instantly share code, notes, and snippets.

@erkattak
Created April 12, 2013 19:11
Show Gist options
  • Save erkattak/5374370 to your computer and use it in GitHub Desktop.
Save erkattak/5374370 to your computer and use it in GitHub Desktop.
class A < ActiveRecord::Base
serialize :foo, FooSerializer
class FooSerializer
attr_accessor :attributes, :to, :be, :serialized
end
end
class A < ActiveRecord::Base
serialize :foo, FooSerializer
class FooSerializer
attr_accessor :attributes, :to, :be, :serialized
// you might also want to try this, in order to customize the value of the serialized attribute
def custom_attribute
// getting your attribute
end
def custom_attribute=(value)
// setting your attribute
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment