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 61 61 62 62 # Environment-specific configuration. 63 63 require_dependency "environments/#{RAILS_ENV}" 64 ActiveRecord::Base.configurations = File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) }64 ActiveRecord::Base.configurations = YAML::load(ERB.new((IO.read("#{RAILS_ROOT}/config/database.yml"))).result) 65 65 ActiveRecord::Base.establish_connection 66 66 67 67