No commit activity in last 3 years
No release in over 3 years
Storage of configuration values in database
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

Acts as configurable¶ ↑

Provides the capabilities of defining configuration values for a model.

Installation¶ ↑

gem install acts_as_configurable

Initialisation¶ ↑

Migration:

create_table :configurations do |t|
  t.string :name, :value, :null => false
  t.string :configurable_type
  t.integer :configurable_id
end

Configuration model:

class Configuration < ActiveRecord::Base
  belongs_to :configurable, :polymorphic => true
end

Usage¶ ↑

class User < ActiveRecord::Base
 	acts_as_configurable :class_name => 'Configuration'
end

user.configure.name = 'Name'
user.configure.name # => Name