where can I find the code where rails connects to the database when booted
Can someone point me to the code where rails reads the database.yml fi开发者_JAVA百科le to connect to the database when booted. I am using Rails 2.3.3
thanks, ash
It's loaded in lib/initializer.rb (around line 900 in rails 2.3.5):
# Loads and returns the contents of the #database_configuration_file. The
# contents of the file are processed via ERB before being sent through
# YAML::load.
def database_configuration
require 'erb'
YAML::load(ERB.new(IO.read(database_configuration_file)).result)
end
精彩评论