lib/waffle/config.rb in waffle-0.2.1 vs lib/waffle/config.rb in waffle-0.2.2

- old
+ new

@@ -9,10 +9,16 @@ def initialize @config_hash = {'transport' => 'rabbitmq', 'url' => nil, 'encoder' => 'json'} if defined? Rails - @config_hash.merge! YAML.load_file("#{Rails.root}/config/#{Rails.env}.waffle.yml") + if File.exists? "#{Rails.root}/config/waffle.yml" + loaded_config = YAML.load_file("#{Rails.root}/config/waffle.yml") + + if loaded_config[Rails.env] + @config_hash.merge! loaded_config[Rails.env] + end + end end end class << self