2009-03-24 17:25:33 +01:00
|
|
|
# Loads and returns config and databases for selected foodcoop.
|
2009-03-24 17:01:10 +01:00
|
|
|
module Foodsoft
|
|
|
|
@@configs = YAML.load(File.read(RAILS_ROOT + "/config/app_config.yml"))
|
|
|
|
@@databases = YAML.load(File.read(RAILS_ROOT + "/config/database.yml"))
|
|
|
|
@@env = RAILS_ENV
|
|
|
|
|
2009-03-24 17:25:33 +01:00
|
|
|
def env=(env)
|
2009-03-24 17:01:10 +01:00
|
|
|
@@env = env
|
|
|
|
end
|
|
|
|
|
2009-03-24 17:25:33 +01:00
|
|
|
def env
|
|
|
|
@@env
|
|
|
|
end
|
|
|
|
|
2009-03-24 17:01:10 +01:00
|
|
|
def config(rails_env = @@env)
|
|
|
|
@@configs[rails_env].symbolize_keys
|
|
|
|
end
|
|
|
|
|
|
|
|
def database(rails_env = @@env)
|
|
|
|
@@databases[rails_env].symbolize_keys
|
|
|
|
end
|
|
|
|
|
|
|
|
extend self
|
|
|
|
end
|
|
|
|
|
2009-01-06 15:45:19 +01:00
|
|
|
|
|
|
|
# Configuration of the exception_notification plugin
|
|
|
|
# Mailadresses are set in config/foodsoft.yaml
|
2009-03-24 17:25:33 +01:00
|
|
|
ExceptionNotifier.exception_recipients = Foodsoft.config[:notification]['error_recipients']
|
|
|
|
ExceptionNotifier.sender_address = Foodsoft.config[:notification]['sender_address']
|
|
|
|
ExceptionNotifier.email_prefix = Foodsoft.config[:notification]['email_prefix']
|