Skip to content

Commit d70a1c9

Browse files
committed
merging environment-specific conf.
1 parent 20f7a8e commit d70a1c9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/jammit.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ def self.load_configuration(config_path, soft=false)
6565
raise ConfigurationNotFound, "could not find the \"#{config_path}\" configuration file" unless exists
6666
conf = YAML.load(ERB.new(File.read(config_path)).result)
6767

68-
# Optionally overwrite configurations based on the environment
68+
# Optionally overwrite configuration based on the environment.
6969
rails_env = defined?(Rails) ? Rails.env : RAILS_ENV
70-
if conf.has_key?(rails_env) && conf[rails_env].is_a?(Hash)
71-
conf.merge!(conf.delete(rails_env))
72-
end
70+
conf.merge! conf.delete rails_env if conf.has_key? rails_env
7371

7472
@config_path = config_path
7573
@configuration = symbolize_keys(conf)

0 commit comments

Comments
 (0)