views:

22

answers:

1

Can someone point me to the code where rails reads the database.yml file to connect to the database when booted. I am using Rails 2.3.3

thanks, ash

A: 

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
grifaton