Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

DYE/has_serialized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AttributeSerializer
===================

Based on the Attribute Serializer article written by Greg Moreno
http://gregmoreno.ca/preventing-model-explosion-via-rails-serialization/


Example
=======

class User < ActiveRecord::Base
	has_serialized :preferences, :show_email => false, :locale => :en
end

u = User.new  # automatically assigns the default preferences
u.preferences 
=> {:show_email => false, :locale => :en}
 
u.show_email = true  # I can change it like an attribute via @user.update_attributes(params[:user])
u.preferences
=> {:show_email => true, :locale => :en }


Copyright (c) 2011 Greg Moreno and Adam Cuppy, released under the MIT license

About

AR plugin to manage serialized attributes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages