diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-16 11:15:55 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-16 11:44:29 -0700 |
commit | b952470cc228ce4438226e180454bb141063b0ca (patch) | |
tree | cbf4b36f237ed456614a0b6c605f831886a0bc15 /activerecord/lib/active_record/connection_adapters/abstract | |
parent | 79d9e0f15522c981fcd1005cec9d441ff96725f5 (diff) | |
download | rails-b952470cc228ce4438226e180454bb141063b0ca.tar.gz rails-b952470cc228ce4438226e180454bb141063b0ca.tar.bz2 rails-b952470cc228ce4438226e180454bb141063b0ca.zip |
use an attr_reader for performance
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 6 |
1 files changed, 2 insertions, 4 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 c2d79a421d..5dcc625ade 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -290,14 +290,12 @@ module ActiveRecord # ActiveRecord::Base.connection_handler. Active Record models use this to # determine that connection pool that they should use. class ConnectionHandler + attr_reader :connection_pools + def initialize(pools = {}) @connection_pools = pools end - def connection_pools - @connection_pools ||= {} - end - def establish_connection(name, spec) @connection_pools[name] = ConnectionAdapters::ConnectionPool.new(spec) end |