Fiona - Rails 3 configuration data engine.

Fiona lets you store unstructured configuration data in your SQL database. Examples include application settings and template data. Any JSON compatible datastructures and values are permitted (integer, float, string, hash, array, true, false, null, etc).

Requirements

Gem Installation

With bundler

Add the following to your Gemfile and run the ‘bundle’ command:

gem "fiona"

Configuration

After you install the gem, you need to run Fiona’s generator:

rails generate fiona

Usage

Create an instance of Template:

t = Template.new(:key => 'some_template')
t.some_var = 'some sweet value'
t.save!

In the above example, ‘t’ can have as many variables associated with it as you want. Their values can be any JSON supported datatype including hashes, array, strings, etc.

Subclassing

The Template class can be subclassed since it uses Rails STI. The included SettingsTemplate feature is an example of this.

SettingsTemplate

Fiona comes with a template class named SettingsTemplate and an associated Rails initializer. Together they simplify the management of application settings and provide your application with globally accessible settings through the ‘S’ constant.

TODO

Contributing to Fiona

Copyright © 2011 Chad Remesch. See LICENSE.txt for further details.