Skip to content

philipp-ullmann/acts_as_configurable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Provides the capabilities of defining configuration values for a model.

gem install acts_as_configurable

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
class User < ActiveRecord::Base
 	acts_as_configurable :class_name => 'Configuration'
end

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

About

Storage of configuration values in database

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages