Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #1822: parse_erb_in_database_yml.patch

File parse_erb_in_database_yml.patch, 0.6 kB (added by duane.johnson@gmail.com, 3 years ago)
  • railties/environments/environment.rb

    old new  
    6161 
    6262# Environment-specific configuration. 
    6363require_dependency "environments/#{RAILS_ENV}" 
    64 ActiveRecord::Base.configurations = File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) } 
     64ActiveRecord::Base.configurations = YAML::load(ERB.new((IO.read("#{RAILS_ROOT}/config/database.yml"))).result) 
    6565ActiveRecord::Base.establish_connection 
    6666 
    6767