开发者

where can I find the code where rails connects to the database when booted

开发者 https://www.devze.com 2023-01-04 02:01 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消