Class: MultiTenantSubdomain::Configuration
- Inherits:
-
Object
- Object
- MultiTenantSubdomain::Configuration
- Defined in:
- lib/multi_tenant_subdomain.rb
Overview
Configuration class for the module.
Instance Attribute Summary collapse
-
#tenant_model_class ⇒ String
The name of the tenant model class.
-
#tenant_model_fk ⇒ String
The name of the foreign key column on the models that should be scoped to a tenant.
-
#tenant_model_pk ⇒ String
The name of the primary key column on the tenant model.
-
#tenant_model_table ⇒ String
The name of the tenant model table.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Initializes a new Configuration object with default values.
Constructor Details
#initialize ⇒ Configuration
Initializes a new Configuration object with default values.
64 65 66 67 68 69 |
# File 'lib/multi_tenant_subdomain.rb', line 64 def initialize @tenant_model_class = "Tenant" @tenant_model_table = "tenants" @tenant_model_pk = "id" @tenant_model_fk = "tenant_id" end |
Instance Attribute Details
#tenant_model_class ⇒ String
Returns The name of the tenant model class. Default: “Tenant”.
46 47 48 |
# File 'lib/multi_tenant_subdomain.rb', line 46 def tenant_model_class @tenant_model_class end |
#tenant_model_fk ⇒ String
Returns The name of the foreign key column on the models that should be scoped to a tenant. Default: “tenant_id”.
61 62 63 |
# File 'lib/multi_tenant_subdomain.rb', line 61 def tenant_model_fk @tenant_model_fk end |
#tenant_model_pk ⇒ String
Returns The name of the primary key column on the tenant model. Default: “id”.
56 57 58 |
# File 'lib/multi_tenant_subdomain.rb', line 56 def tenant_model_pk @tenant_model_pk end |
#tenant_model_table ⇒ String
Returns The name of the tenant model table. Default: “tenants”.
51 52 53 |
# File 'lib/multi_tenant_subdomain.rb', line 51 def tenant_model_table @tenant_model_table end |