What line (or method) in the ActiveRecord code base does config / database.yml load for the Rails application? (I look at 4.0.5 specifically, but if someone has information about> = 4.0.5, this will cover)?
It is inside the rails, in particular, in the file railties/lib/rails/application/configuration.rbon lines 101-116 (for Rails 4.0.6):
railties/lib/rails/application/configuration.rb
https://github.com/rails/rails/blob/4-0-6/railties/lib/rails/application/configuration.rb#L101-L116
# Loads and returns the configuration of the database. def database_configuration yaml = paths["config/database"].first if File.exist?(yaml) require "erb" YAML.load ERB.new(IO.read(yaml)).result elsif ENV['DATABASE_URL'] nil else raise "Could not load database configuration. No such file - #{yaml}" end rescue Psych::SyntaxError => e raise "YAML syntax error occurred while parsing #{paths["config/database"].first}. " \ "Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \ "Error: #{e.message}" end
Rails 4.0.6 "database.yml" -File :
paths.add "config/database", with: "config/database.yml"
( ) :
YAML.load ERB.new(IO.read(yaml)).result
Source: https://habr.com/ru/post/1673167/More articles:ng-bootstrap NgbTypeahead How to respond to a choice? - angularConnect to an existing Heroku Postgres database for Sinatra - ruby โโ| fooobar.comHow to โlayoutโ a .geolocation navigator in React Jest Test - unit-testingASP.NET MVC project with a section written in Angular2: build error occurs when using MvcBuildViews - angularHow to run spring application in cloud foundry as a one-time task using java buildpack - cloudfoundryForbidden error Laravel 403 - phpAngular Extension Material2 MdTab Component - inheritanceError: Undefined blocking protocol found in the blocking file. Expected 3, found 0. - androidะะฐะบ ะฝะฐัััะพะธัั jsdom ัะพ ัััะบะพะน - javascriptHow to link RCTCameraRoll for Android - javascriptAll Articles