Module: ActiveRecord::Tenanted::DatabaseConfigurations

Defined in:
lib/active_record/tenanted/database_configurations.rb,
lib/active_record/tenanted/database_configurations/base_config.rb,
lib/active_record/tenanted/database_configurations/tenant_config.rb

Defined Under Namespace

Classes: BaseConfig, TenantConfig

Class Method Summary collapse

Class Method Details

.register_db_config_handlerObject

:nodoc:



8
9
10
11
12
13
14
# File 'lib/active_record/tenanted/database_configurations.rb', line 8

def self.register_db_config_handler # :nodoc:
  ActiveRecord::DatabaseConfigurations.register_db_config_handler do |env_name, name, _, config|
    next unless config.fetch(:tenanted, false)

    ActiveRecord::Tenanted::DatabaseConfigurations::BaseConfig.new(env_name, name, config)
  end
end