aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_handling.rb
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2018-11-15 00:39:29 +0200
committerbogdanvlviv <bogdanvlviv@gmail.com>2018-11-15 11:48:07 +0200
commitcf01da283e7ff6765b9ecb21215160650c87635a (patch)
treed47906eef999919546dd2cf81b24a37476ed4b93 /activerecord/lib/active_record/connection_handling.rb
parentf9ba12bd5382dc3251debce81f0c82566aee7581 (diff)
downloadrails-cf01da283e7ff6765b9ecb21215160650c87635a.tar.gz
rails-cf01da283e7ff6765b9ecb21215160650c87635a.tar.bz2
rails-cf01da283e7ff6765b9ecb21215160650c87635a.zip
Exercise `connected_to` and `connects_to` methods
Since both methods are public API I think it makes sense to add these tests in order to prevent any regression in the behavior of those methods after the 6.0 release. Exercise `connected_to` - Ensure that the method raises with both `database` and `role` arguments - Ensure that the method raises without `database` and `role` Exercise `connects_to` - Ensure that the method returns an array of established connections(as mentioned in the docs of the method) Related to #34052
Diffstat (limited to 'activerecord/lib/active_record/connection_handling.rb')
-rw-r--r--activerecord/lib/active_record/connection_handling.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb
index 777cb8a402..3ce9aad5fc 100644
--- a/activerecord/lib/active_record/connection_handling.rb
+++ b/activerecord/lib/active_record/connection_handling.rb
@@ -107,7 +107,7 @@ module ActiveRecord
# end
def connected_to(database: nil, role: nil, &blk)
if database && role
- raise ArgumentError, "connected_to can only accept a database or role argument, but not both arguments."
+ raise ArgumentError, "connected_to can only accept a `database` or a `role` argument, but not both arguments."
elsif database
if database.is_a?(Hash)
role, database = database.first