AppConfig also supports many different 'storage methods', such as YAML and MongoDB,
allowing you to tailor AppConfig to many different use cases. For example,
storing your configuration in the same database as your development/production environment.

Mongo

You can pass a :mongo options hash to AppConfig.setup! which should contain
configuration values for a Mongo database. Check the AppConfig::Storage::Mongo::DEFAULTS
constant for the default Mongo connection options.

The values are read/saved (by default) to the app_config database and
app_config collection. These defaults can be overridden, however, which
might lend well to versioned configurations; collection names such as
app_config_v1, app_config_v2, etc.

# These are the defaults.
postgres_opts={host:'localhost',port:5432,dbname:'app_config',table:'app_config',# If these are nil (or omitted), the PostgreSQL defaults will be used.
user:nil,password:nil,}AppConfig.setup!(postgres:postgres_opts)AppConfig.admin_email# => '[email protected]'
# Override an existing value and save to the database:
AppConfig.admin_email='[email protected]'AppConfig.save!

MySQL

Using MySQL is similar to Postgres, including the required primary key named id.
All other columns are used as configuration keys.