We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 135103b commit 127c9e3Copy full SHA for 127c9e3
1 file changed
lib/jammit.rb
@@ -66,8 +66,9 @@ def self.load_configuration(config_path, soft=false)
66
conf = YAML.load(ERB.new(File.read(config_path)).result)
67
68
# Optionally overwrite configurations based on the environment
69
- if conf.has_key?(RAILS_ENV) && conf[RAILS_ENV].is_a?(Hash)
70
- conf.merge!(conf.delete(RAILS_ENV))
+ rails_env = defined?(Rails) ? Rails.env : RAILS_ENV
+ if conf.has_key?(rails_env) && conf[rails_env].is_a?(Hash)
71
+ conf.merge!(conf.delete(rails_env))
72
end
73
74
@config_path = config_path
0 commit comments