Module: ActiveRecord::Base::SeamlessDatabasePoolBehavior

Included in:
ActiveRecord::Base
Defined in:
lib/active_record/connection_adapters/seamless_database_pool_adapter.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


65
66
67
# File 'lib/active_record/connection_adapters/seamless_database_pool_adapter.rb', line 65

def self.included(base)
  base.alias_method_chain(:reload, :seamless_database_pool)
end

Instance Method Details

#reload_with_seamless_database_pool(*args) ⇒ Object

Force reload to use the master connection since it's probably being called for a reason.


70
71
72
73
74
# File 'lib/active_record/connection_adapters/seamless_database_pool_adapter.rb', line 70

def reload_with_seamless_database_pool(*args)
  SeamlessDatabasePool.use_master_connection do
    reload_without_seamless_database_pool(*args)
  end
end