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

Changeset 1910

Show
Ignore:
Timestamp:
07/24/05 08:16:07 (3 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/CHANGELOG

    r1909 r1910  
    11*SVN* 
     2 
     3* 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] 
    24 
    35* Added convenience controls for FCGI processes (especially when managed remotely): spinner, spawner, and reaper. They reside in script/process. More details can be had by calling them with -h/--help. 
  • 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