start of making nickname optional

This commit is contained in:
wvengen 2013-09-20 22:40:13 +02:00
parent a77c3b59b1
commit e4f0a1e3ed
33 changed files with 92 additions and 48 deletions

View file

@ -9,6 +9,8 @@ class FoodsoftConfig
set_config Rails.env
# Overwrite scope to have a better namescope than 'production'
self.scope = config[:default_scope] or raise "No default_scope is set"
# Set defaults for backward-compatibility
set_missing
end
# Set config and database connection for specific foodcoop
@ -46,5 +48,13 @@ class FoodsoftConfig
ActiveRecord::Base.establish_connection(database_config)
end
# When new options are introduced, put backward-compatible defaults here, so that
# configuration files that haven't been updated, still work as they did.
def set_missing
config.replace({
use_nick: true
}.merge(config))
end
end
end
end