Method: Tenantify::Configuration#strategy

Defined in:
lib/tenantify/configuration.rb

#strategy(name_or_class, strategy_config = {}) ⇒ Array<strategy_config>

Adds a new strategy for the Tenantify middleware. The order the strategies are added is the priority order they have to match the tenant.

Parameters:

  • the (Symbol, Class)

    name of a known strategy or a custom strategy class.

  • strategy (Hash)

    configuration.

Returns:

  • (Array<strategy_config>)

    a collection of strategy configurations.



21
22
23
# File 'lib/tenantify/configuration.rb', line 21

def strategy name_or_class, strategy_config = {}
  strategies << [name_or_class, strategy_config]
end