No commit activity in last 3 years
No release in over 3 years
Simple global Settings class for ActiveRecord based applications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3.8
>= 0
~> 2.14.1
~> 1.3

Runtime

 Project Readme

Persistent Settings

Build Status

A simple key value store for ActiveRecord based applications.

Best used to store global app settings.

Installation

Add it to your Gemfile

gem 'persistent_settings'

Install

bundle install

Use the generator to create a Config class, or whatever you want to call it, that will include all the Persistent Settings functionality.

rails g persistent_settings:create config

Run migrations

rake db:migrate

Usage

Assuming that your Persistent Settings class is named Config, it will automatically create new keys as you assign a value to them.

Config.a_key = 'value'

Reload your app:

Config.a_key # => 'value'

It accepts all kinds of objects as the value

Known Issues

Sometimes, settings are not loaded automatically at startup. If that's the case add an initializer to your Rails app.

#
# config/initializers/settings.rb
#

Settings.load_from_persistance

Important

Starting from version 1.4 this gem is compatible with Rails 4.0 or better, if you are looking for a version compatible with Rails 3.x then use version 1.3 of this gem.

License

MIT License. Copyright 2011, Crowd Interactive http://www.crowdint.com