Class: PostgresMultitenant::Configuration
- Inherits:
-
Object
- Object
- PostgresMultitenant::Configuration
- Defined in:
- lib/postgres_multitenant/configuration.rb
Instance Attribute Summary collapse
-
#default_schema ⇒ Object
Returns the value of attribute default_schema.
-
#excluded_subdomains ⇒ Object
Returns the value of attribute excluded_subdomains.
-
#subdomain_extractor ⇒ Object
Returns the value of attribute subdomain_extractor.
-
#system_tables ⇒ Object
Returns the value of attribute system_tables.
-
#tenant_class_name ⇒ Object
Returns the value of attribute tenant_class_name.
-
#tenant_finder ⇒ Object
Returns the value of attribute tenant_finder.
-
#tenant_foreign_key ⇒ Object
Returns the value of attribute tenant_foreign_key.
-
#tenant_not_found_handler ⇒ Object
Returns the value of attribute tenant_not_found_handler.
-
#tenant_not_found_strategy ⇒ Object
Returns the value of attribute tenant_not_found_strategy.
-
#tenant_schema_name_proc ⇒ Object
Returns the value of attribute tenant_schema_name_proc.
-
#tenant_scope_proc ⇒ Object
Returns the value of attribute tenant_scope_proc.
-
#tenant_table_resolver ⇒ Object
Returns the value of attribute tenant_table_resolver.
-
#terminate_connections_on_drop ⇒ Object
Returns the value of attribute terminate_connections_on_drop.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #tenant_class ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/postgres_multitenant/configuration.rb', line 21 def initialize @tenant_class_name = 'Organization' @tenant_finder = nil @tenant_scope_proc = nil @tenant_schema_name_proc = nil @tenant_foreign_key = 'organization_id' @tenant_table_resolver = nil @default_schema = 'public' @system_tables = %w[ action_text_rich_texts active_storage_attachments active_storage_blobs active_storage_variant_records ] @excluded_subdomains = %w[www api admin mail ftp] @subdomain_extractor = nil @tenant_not_found_strategy = :raise @tenant_not_found_handler = nil @terminate_connections_on_drop = false end |
Instance Attribute Details
#default_schema ⇒ Object
Returns the value of attribute default_schema.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def default_schema @default_schema end |
#excluded_subdomains ⇒ Object
Returns the value of attribute excluded_subdomains.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def excluded_subdomains @excluded_subdomains end |
#subdomain_extractor ⇒ Object
Returns the value of attribute subdomain_extractor.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def subdomain_extractor @subdomain_extractor end |
#system_tables ⇒ Object
Returns the value of attribute system_tables.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def system_tables @system_tables end |
#tenant_class_name ⇒ Object
Returns the value of attribute tenant_class_name.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_class_name @tenant_class_name end |
#tenant_finder ⇒ Object
Returns the value of attribute tenant_finder.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_finder @tenant_finder end |
#tenant_foreign_key ⇒ Object
Returns the value of attribute tenant_foreign_key.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_foreign_key @tenant_foreign_key end |
#tenant_not_found_handler ⇒ Object
Returns the value of attribute tenant_not_found_handler.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_not_found_handler @tenant_not_found_handler end |
#tenant_not_found_strategy ⇒ Object
Returns the value of attribute tenant_not_found_strategy.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_not_found_strategy @tenant_not_found_strategy end |
#tenant_schema_name_proc ⇒ Object
Returns the value of attribute tenant_schema_name_proc.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_schema_name_proc @tenant_schema_name_proc end |
#tenant_scope_proc ⇒ Object
Returns the value of attribute tenant_scope_proc.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_scope_proc @tenant_scope_proc end |
#tenant_table_resolver ⇒ Object
Returns the value of attribute tenant_table_resolver.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def tenant_table_resolver @tenant_table_resolver end |
#terminate_connections_on_drop ⇒ Object
Returns the value of attribute terminate_connections_on_drop.
7 8 9 |
# File 'lib/postgres_multitenant/configuration.rb', line 7 def terminate_connections_on_drop @terminate_connections_on_drop end |
Instance Method Details
#tenant_class ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/postgres_multitenant/configuration.rb', line 42 def tenant_class return nil if tenant_class_name.to_s.empty? tenant_class_name.constantize rescue NameError nil end |