Permalink
Browse files

close database.yml after reading in configuration #841 [sebastian.kan…

…thak]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@914 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 2f94412 commit 78a732bf3ffaab0788c2962d03a059b3a8324a5f @dhh dhh committed Mar 17, 2005
Showing with 2 additions and 2 deletions.
  1. +1 −1 railties/environments/shared.rb
  2. +1 −1 railties/environments/shared_for_gem.rb
@@ -43,7 +43,7 @@
# Environment-specific configuration.
require_dependency "environments/#{RAILS_ENV}"
-ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
+ActiveRecord::Base.configurations = File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) }
ActiveRecord::Base.establish_connection
@@ -38,7 +38,7 @@
# Environment-specific configuration.
require_dependency "environments/#{RAILS_ENV}"
-ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
+ActiveRecord::Base.configurations = File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) }
ActiveRecord::Base.establish_connection

0 comments on commit 78a732b

Please sign in to comment.