Skip to content
Browse files

use an attr_reader for performance

  • Loading branch information...
1 parent 79d9e0f commit b952470cc228ce4438226e180454bb141063b0ca @tenderlove tenderlove committed
Showing with 2 additions and 4 deletions.
  1. +2 −4 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -290,14 +290,12 @@ def checkout_and_verify(c)
# 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

0 comments on commit b952470

Please sign in to comment.
Something went wrong with that request. Please try again.