Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
07/24/05 08:16:07 (5 years ago)
Author:
david
Message:

Allow ERb in the database.yml file (just like with fixtures), so you can pull out the database configuration in environment variables #1822 [Duane Johnson]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/environments/environment.rb

    r1875 r1910  
    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