Module: ConsoleKit::TenantConfigurator
- Defined in:
- lib/console_kit/tenant_configurator.rb
Overview
For tenant configuration
Constant Summary collapse
- HANDLER_ATTRIBUTES =
{ Connections::SqlConnectionHandler => :tenant_shard, Connections::MongoConnectionHandler => :tenant_mongo_db, Connections::RedisConnectionHandler => :tenant_redis_db, Connections::ElasticsearchConnectionHandler => :tenant_elasticsearch_prefix }.freeze
Class Method Summary collapse
- .clear ⇒ Object
- .configuration_success ⇒ Object
- .configuration_success=(val) ⇒ Object
- .configure_tenant(key) ⇒ Object
Class Method Details
.clear ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/console_kit/tenant_configurator.rb', line 33 def clear ctx = ConsoleKit.configuration.context_class return unless ctx reset_tenant(ctx) Output.print_info('Tenant context has been cleared.') end |
.configuration_success ⇒ Object
18 |
# File 'lib/console_kit/tenant_configurator.rb', line 18 def configuration_success = Thread.current[:console_kit_configuration_success] |
.configuration_success=(val) ⇒ Object
20 21 22 |
# File 'lib/console_kit/tenant_configurator.rb', line 20 def configuration_success=(val) Thread.current[:console_kit_configuration_success] = val end |
.configure_tenant(key) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/console_kit/tenant_configurator.rb', line 24 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 |