]> git.openstreetmap.org Git - rails.git/blob - config/preinitializer.rb
Rework the login page to explain better what to do if you're new
[rails.git] / config / preinitializer.rb
1 require 'yaml'
2
3 config = YAML.load_file("#{RAILS_ROOT}/config/application.yml")
4 env = ENV['RAILS_ENV'] || 'development'
5
6 ENV.each do |key,value|
7   if key.match(/^OSM_(.*)$/)
8     Object.const_set(Regexp.last_match(1).upcase, value)
9   end
10 end
11
12 config[env].each do |key,value|
13   unless Object.const_defined?(key.upcase)
14     Object.const_set(key.upcase, value)
15   end
16 end