diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-24 08:16:07 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-24 08:16:07 +0000 |
commit | b25f9af998ad26653083e004b7a6cb9ca0061940 (patch) | |
tree | 1cd37b224c70d49a8a632d05457bef5655163b4a /railties/environments/environment.rb | |
parent | d75481c5808085935e94fcbf6460c7685ef26396 (diff) | |
download | rails-b25f9af998ad26653083e004b7a6cb9ca0061940.tar.gz rails-b25f9af998ad26653083e004b7a6cb9ca0061940.tar.bz2 rails-b25f9af998ad26653083e004b7a6cb9ca0061940.zip |
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
Diffstat (limited to 'railties/environments/environment.rb')
-rw-r--r-- | railties/environments/environment.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 4131c5cb16..896a8faf49 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -61,7 +61,7 @@ require 'action_web_service' # 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 |