Skip to content
Browse files

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]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent d75481c commit b25f9af998ad26653083e004b7a6cb9ca0061940 @dhh dhh committed Jul 24, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 railties/CHANGELOG
  2. +1 −1 railties/environments/environment.rb
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* 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]
+
* 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.
* Added load_fixtures task to the Rakefile, which will load all the fixtures into the database for the current environment #1791 [Marcel Molina]
View
2 railties/environments/environment.rb
@@ -61,7 +61,7 @@
# Environment-specific configuration.
require_dependency "environments/#{RAILS_ENV}"
-ActiveRecord::Base.configurations = File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) }
+ActiveRecord::Base.configurations = YAML::load(ERB.new((IO.read("#{RAILS_ROOT}/config/database.yml"))).result)
ActiveRecord::Base.establish_connection

0 comments on commit b25f9af

Please sign in to comment.
Something went wrong with that request. Please try again.