Module: ConsoleKit::TenantConfigurator

Defined in:
lib/console_kit/tenant_configurator.rb

Overview

For tenant configuration

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configuration_successObject (readonly)

Returns the value of attribute configuration_success.



10
11
12
# File 'lib/console_kit/tenant_configurator.rb', line 10

def configuration_success
  @configuration_success
end

Class Method Details

.clearObject



21
22
23
24
25
26
27
# File 'lib/console_kit/tenant_configurator.rb', line 21

def clear
  @configuration_success = false
  i[tenant_shard tenant_mongo_db partner_identifier].each do |attr|
    ConsoleKit.configuration.context_class.public_send("#{attr}=", nil)
  end
  Output.print_info('Tenant context has been cleared.')
end

.configure_tenant(key) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/console_kit/tenant_configurator.rb', line 12

def configure_tenant(key)
  constants = ConsoleKit.configuration.tenants[key]&.[](:constants)
  return missing_config_error(key) unless constants

  perform_configuration(key, constants)
rescue StandardError => e
  handle_error(e, key)
end