Class: ActiveVersion::Sharding::ConnectionRouter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_version/sharding/connection_router.rb,
sig/active_version/advanced.rbs

Overview

No-op router. Connection routing is application-owned.

Class Method Summary collapse

Class Method Details

.adapter_for(model_class, version_type) ⇒ Object

Parameters:

  • model_class (Class)
  • version_type (Symbol)

Returns:

  • (Object)


10
11
12
# File 'lib/active_version/sharding/connection_router.rb', line 10

def adapter_for(model_class, version_type)
  ActiveVersion.adapter_for(model_class, version_type)
end

.connection_for(model_class, version_type) ⇒ Symbol, ...

Parameters:

  • model_class (Class)
  • version_type (Symbol)

Returns:

  • (Symbol, String, untyped)


6
7
8
# File 'lib/active_version/sharding/connection_router.rb', line 6

def connection_for(model_class, version_type)
  :default
end

.with_connection(model_class, version_type) {|arg0| ... } ⇒ Object

Parameters:

  • model_class (Class)
  • version_type (Symbol)

Yields:

Yield Parameters:

  • arg0 (Object)

Yield Returns:

  • (Object)

Returns:

  • (Object)


14
15
16
# File 'lib/active_version/sharding/connection_router.rb', line 14

def with_connection(model_class, version_type, &block)
  ActiveVersion.with_connection(model_class, version_type, &block)
end