0.0
No commit activity in last 3 years
No release in over 3 years
Add simple name-value pairs to any ActiveRecord model and provide seamless getters, setters, and interrogators.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 2.0.0, < 3.0.0
 Project Readme

AppAttributes

A very simple polymorphic implementation of name-value pairs for any ActiveRecord model. The value is serialized to allow storage of ruby objects.

Install

sudo gem install app_attributes

OR

gem 'app_attributes'
bundle install

Usage

in your model:

class Author < ActiveRecord::Base
  include AppAttributes

  ext_attribute :hat_size, 10, :to_i
  # args: attribute name, default value, casting method for returned value
  # provides @author.hat_size, @author.hat_size=, @author.hat_size?
  # returns value cast as integer
end

TODO

  • automate db migration. currently, you must manually copy/rename migration file in app_attributes/db/migrate
  • build out tests likely as a nested Rails app

Copyright and license

Copyright (c) 2011 Luke Wendling, released under the New BSD License

Contributors:

  • Jeff Pihl
  • Scott Robertson
  • Mike Hansen