foodsoft/config/initializers/load_app_config.rb

27 lines
1 KiB
Ruby
Raw Normal View History

# Initial load the default config and database from rails environment
# See config/app_config.yml for further details
# Load Config, start by selecting defaults via current environment
require 'foodsoft_config'
FoodsoftConfig.init
# Set action mailer default host for url generating
url_options = {
:host => FoodsoftConfig[:host],
:protocol => FoodsoftConfig[:protocol]
}
url_options.merge!({:port => FoodsoftConfig[:port]}) if FoodsoftConfig[:port]
2011-05-11 11:01:47 +02:00
Foodsoft::Application.configure do
config.action_mailer.default_url_options = url_options
if Rails.env !~ /development|test/
# Configuration of the exception_notification plugin
# Mailadresses are set in config/app_config.yml
config.middleware.use ExceptionNotifier,
:email_prefix => FoodsoftConfig[:notification]['email_prefix'],
:sender_address => FoodsoftConfig[:notification]['sender_address'],
:exception_recipients => FoodsoftConfig[:notification]['error_recipients']
end
2011-05-11 11:01:47 +02:00
end