1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

close database.yml after reading in configuration #841 [sebastian.kanthak]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@914 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-03-17 19:34:18 +00:00
parent 2f944123f3
commit 78a732bf3f
2 changed files with 2 additions and 2 deletions

View file

@ -43,7 +43,7 @@ require 'action_web_service'
# Environment-specific configuration. # Environment-specific configuration.
require_dependency "environments/#{RAILS_ENV}" 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 ActiveRecord::Base.establish_connection

View file

@ -38,7 +38,7 @@ require_gem 'rails'
# Environment-specific configuration. # Environment-specific configuration.
require_dependency "environments/#{RAILS_ENV}" 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 ActiveRecord::Base.establish_connection