Commit 6466fec2109c1af85d3716dd23a357ac85ce680a
1 parent
eebdb970
Exists in
master
and in
1 other branch
Changed config to handle Heroku
Showing
1 changed file
with
11 additions
and
4 deletions
Show diff stats
config/initializers/_load_config.rb
| 1 | 1 | require 'ostruct' |
| 2 | 2 | |
| 3 | -yaml = File.read(Rails.root.join('config','config.yml')) | |
| 4 | -config = YAML.load(yaml) | |
| 3 | +if ENV['HEROKU'] | |
| 4 | + Errbit::Config = OpenStruct.new | |
| 5 | + Errbit::Config.host = ENV['ERRBIT_HOST'] | |
| 6 | + Errbit::Config.email_from = ENV['ERRBIT_EMAIL_FROM'] | |
| 7 | + Errbit::Config.email_at_notices = [1,3,10] #ENV['ERRBIT_EMAIL_AT_NOTICES'] | |
| 8 | +else | |
| 9 | + yaml = File.read(Rails.root.join('config','config.yml')) | |
| 10 | + config = YAML.load(yaml) | |
| 5 | 11 | |
| 6 | -config.merge!(config.delete(Rails.env)) if config.has_key?(Rails.env) | |
| 12 | + config.merge!(config.delete(Rails.env)) if config.has_key?(Rails.env) | |
| 7 | 13 | |
| 8 | -Errbit::Config = OpenStruct.new(config) | |
| 14 | + Errbit::Config = OpenStruct.new(config) | |
| 15 | +end | |
| 9 | 16 | |
| 10 | 17 | # Set config specific values |
| 11 | 18 | ActionMailer::Base.default_url_options[:host] = Errbit::Config.host |
| 12 | 19 | \ No newline at end of file | ... | ... |