allow to put foodcoop config in database

This commit is contained in:
wvengen 2014-03-16 02:07:54 +01:00
parent a39c56fdf1
commit dd3ac0971c
2 changed files with 1 additions and 13 deletions

View File

@ -66,18 +66,6 @@ ActiveRecord::Schema.define(version: 20140521142651) do
add_index "assignments", ["user_id", "task_id"], name: "index_assignments_on_user_id_and_task_id", unique: true, using: :btree
create_table "configurable_settings", force: true do |t|
t.integer "configurable_id"
t.string "configurable_type"
t.integer "targetable_id"
t.string "targetable_type"
t.string "name", default: "", null: false
t.string "value_type"
t.text "value"
end
add_index "configurable_settings", ["name"], name: "index_configurable_settings_on_name", using: :btree
create_table "deliveries", force: true do |t|
t.integer "supplier_id"
t.date "delivered_on"

View File

@ -26,7 +26,7 @@ class FoodsoftConfig
# Provides a nice accessor for config values
# FoodsoftConfig[:name] # => 'FC Test'
def [](key)
config[key]
RailsSettings::CachedSettings["foodcoop.#{self.scope}.#{key}"] || config[key]
end
# Loop through each foodcoop and executes the given block after setup config and database