aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2016-05-06 15:11:48 -0500
committerArthur Neves <arthurnn@gmail.com>2016-05-06 15:11:48 -0500
commit36ce6aba980a176b03e675c157f51048985d4730 (patch)
treeea22c88f1b968ead44397ea5c04287352ded936f /activerecord
parent22a127c57baa533498124e1650d00fb780618ed2 (diff)
downloadrails-36ce6aba980a176b03e675c157f51048985d4730.tar.gz
rails-36ce6aba980a176b03e675c157f51048985d4730.tar.bz2
rails-36ce6aba980a176b03e675c157f51048985d4730.zip
Update docs for connection handler
[skip ci]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index 0498737b20..4ba8ee2706 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -778,8 +778,7 @@ module ActiveRecord
end
# ConnectionHandler is a collection of ConnectionPool objects. It is used
- # for keeping separate connection pools for Active Record models that connect
- # to different databases.
+ # for keeping separate connection pools that connect to different databases.
#
# For example, suppose that you have 5 models, with the following hierarchy:
#
@@ -821,6 +820,10 @@ module ActiveRecord
# ConnectionHandler accessible via ActiveRecord::Base.connection_handler.
# All Active Record models use this handler to determine the connection pool that they
# should use.
+ #
+ # The ConnectionHandler class is not coupled with the Active models, as it has no knowlodge
+ # about the model. The model, needs to pass a specification name to the handler,
+ # in order to lookup the correct connection pool.
class ConnectionHandler
def initialize
# These caches are keyed by klass.name, NOT klass. Keying them by klass