No commit activity in last 3 years
No release in over 3 years
attribute accessor generator using sattr_accessor (with default field :serialized_options) or a different serialized field using for_serialized_field (with block)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

SerializedAttrAccessors

A gem to provide attributes(accessors) from a serialized column of ActiveRecord::Base

How to use

    1. Include it in gem file.
    1. Add a text column named "serialized_options".
    1. In active_record based model add attributes.

sattr_accessor :name, :string, "some name"

sattr_accessor :roll_no, :integer, 111

sattr_accessor :is_admin, :boolean, true

sattr_accessor :second_name, "kumar"

sattr_accessor :address

    1. In case want to use other attribute instead of "serialized_options", use it like this.
   for_serialized_field :workspaces do
       sattr_accessor :name, :string, "some name"
       sattr_accessor :roll_no, :integer, 111
       sattr_accessor :is_admin, :boolean, true
       sattr_accessor :second_name, "kumar"
       sattr_accessor :address
   end
    1. Enjoy!