aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/database_configurations/url_config.rb
diff options
context:
space:
mode:
authorEileen Uchitelle <eileencodes@gmail.com>2018-08-31 10:55:37 -0400
committerEileen Uchitelle <eileencodes@gmail.com>2018-08-31 16:07:09 -0400
commita572d2283b05c4c05c220ff520732fc570beb2ae (patch)
tree4791f610ea5bd65f6ca4581c593831dcc3f6db85 /activerecord/lib/active_record/database_configurations/url_config.rb
parent8737dffce73a37dff073dfe0af8931efd08632c5 (diff)
downloadrails-a572d2283b05c4c05c220ff520732fc570beb2ae.tar.gz
rails-a572d2283b05c4c05c220ff520732fc570beb2ae.tar.bz2
rails-a572d2283b05c4c05c220ff520732fc570beb2ae.zip
Convert configs_for to kwargs, add include_replicas
Changes the `configs_for` method from using traditional arguments to using kwargs. This is so I can add the `include_replicas` kwarg without having to always include `env_name` and `spec_name` in the method call. `include_replicas` defaults to false because everywhere internally in Rails we don't want replicas. `configs_for` is for iterating over configurations to create / run rake tasks, so we really don't ever need replicas in that case.
Diffstat (limited to 'activerecord/lib/active_record/database_configurations/url_config.rb')
-rw-r--r--activerecord/lib/active_record/database_configurations/url_config.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/database_configurations/url_config.rb b/activerecord/lib/active_record/database_configurations/url_config.rb
index 181f04c3fd..ad4df3d3f2 100644
--- a/activerecord/lib/active_record/database_configurations/url_config.rb
+++ b/activerecord/lib/active_record/database_configurations/url_config.rb
@@ -41,6 +41,9 @@ module ActiveRecord
true
end
+ # Determines whether a database configuration is for a replica / readonly
+ # connection. If the `replica` key is present in the config, `replica?` will
+ # return true.
def replica?
config["replica"]
end