]> git.openstreetmap.org Git - rails.git/blob - config/preinitializer.rb
253f58605f798ef54a6f40acc926c02d49593091
[rails.git] / config / preinitializer.rb
1 require "yaml"
2
3 env = if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
4         "test"
5       else
6         ENV["RAILS_ENV"] || "development"
7       end
8
9 config = YAML.load_file(File.expand_path(env == "test" ? "../example.application.yml" : "../application.yml", __FILE__))
10
11 config[env].each do |key, value|
12   Object.const_set(key.upcase, value) unless Object.const_defined?(key.upcase)
13 end