Skip to content

Commit

Permalink
Renaming _ahrp_per_thread_per_connection_storage -> _ahrp_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
zdennis committed Jun 10, 2020
1 parent d0860ac commit 610fcb1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/active_record_host_pool/connection_adapter_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ module DatabaseSwitch
def self.included(base)
base.class_eval do
def _host_pool_current_database
_ahrp_per_thread_per_connection_storage[:_host_pool_current_database]
_ahrp_storage[:_host_pool_current_database]
end

def _host_pool_current_database=(database)
_ahrp_per_thread_per_connection_storage[:_host_pool_current_database] = database
_ahrp_storage[:_host_pool_current_database] = database
@config[:database] = _host_pool_current_database if ActiveRecord::VERSION::MAJOR >= 5
end

Expand Down Expand Up @@ -109,11 +109,11 @@ def disconnect_with_host_pooling!
attr_accessor :_no_switch

def _cached_current_database
_ahrp_per_thread_per_connection_storage[:_cached_current_database]
_ahrp_storage[:_cached_current_database]
end

def _cached_current_database=(database)
_ahrp_per_thread_per_connection_storage[:_cached_current_database] = database
_ahrp_storage[:_cached_current_database] = database
end

def _cached_connection_object_id
Expand All @@ -139,7 +139,7 @@ def _switch_connection
end
end

def _ahrp_per_thread_per_connection_storage
def _ahrp_storage
DatabaseSwitch.thread_local_storage[_cached_connection_object_id]
end

Expand Down

0 comments on commit 610fcb1

Please sign in to comment.