diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2018-09-09 15:20:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-09 15:20:44 -0400 |
commit | 101096e5421d93b02d9df284385cf305db81cd1f (patch) | |
tree | 5348a25cb988b4f8ea715dcbddfaa0428a3784ae /activerecord/lib | |
parent | 9d848d8545e2f0159d2fcee21fdfbaa1421d1489 (diff) | |
parent | 0a6aa42e029a18fb6aebd40da7eb33bcb39614b4 (diff) | |
download | rails-101096e5421d93b02d9df284385cf305db81cd1f.tar.gz rails-101096e5421d93b02d9df284385cf305db81cd1f.tar.bz2 rails-101096e5421d93b02d9df284385cf305db81cd1f.zip |
Merge pull request #33825 from bogdanvlviv/follow-up-33637-and-33770
Follow up #33637 and #33770
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/database_configurations.rb | 10 | ||||
-rw-r--r-- | activerecord/lib/active_record/database_configurations/hash_config.rb | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/database_configurations.rb b/activerecord/lib/active_record/database_configurations.rb index a94f46d07f..9aabde676a 100644 --- a/activerecord/lib/active_record/database_configurations.rb +++ b/activerecord/lib/active_record/database_configurations.rb @@ -18,8 +18,8 @@ module ActiveRecord # Collects the configs for the environment and optionally the specification # name passed in. To include replica configurations pass `include_replicas: true`. # - # If a spec name is provided a single DatabaseConfiguration object will be - # returned, otherwise an array of DatabaseConfiguration objects will be + # If a spec name is provided a single DatabaseConfig object will be + # returned, otherwise an array of DatabaseConfig objects will be # returned that corresponds with the environment and type requested. # # Options: @@ -53,7 +53,7 @@ module ActiveRecord # Returns the config hash that corresponds with the environment # # If the application has multiple databases `default_hash` will - # the first config hash for the environment. + # return the first config hash for the environment. # # { database: "my_db", adapter: "mysql2" } def default_hash(env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_s) @@ -64,7 +64,7 @@ module ActiveRecord # Returns a single DatabaseConfig object based on the requested environment. # - # If the application has multiple databases `select_db_config` will return + # If the application has multiple databases `find_db_config` will return # the first DatabaseConfig for the environment. def find_db_config(env) configurations.find do |db_config| @@ -73,7 +73,7 @@ module ActiveRecord end end - # Returns the DatabaseConfig object as a Hash. + # Returns the DatabaseConfigurations object as a Hash. def to_h configs = configurations.reverse.inject({}) do |memo, db_config| memo.merge(db_config.to_legacy_hash) diff --git a/activerecord/lib/active_record/database_configurations/hash_config.rb b/activerecord/lib/active_record/database_configurations/hash_config.rb index 18ed7c0466..13ffe566cf 100644 --- a/activerecord/lib/active_record/database_configurations/hash_config.rb +++ b/activerecord/lib/active_record/database_configurations/hash_config.rb @@ -12,7 +12,7 @@ module ActiveRecord # Becomes: # # #<ActiveRecord::DatabaseConfigurations::HashConfig:0x00007fd1acbded10 - # @env_name="development", @spec_name="primary", @config={"db_name"}> + # @env_name="development", @spec_name="primary", @config={"database"=>"db_name"}> # # Options are: # |