Class: MultiTenantSubdomain::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_tenant_subdomain.rb

Overview

Configuration class for the module.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_classString

Returns The name of the tenant model class. Default: “Tenant”.

Returns:

  • (String)

    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_fkString

Returns The name of the foreign key column on the models that should be scoped to a tenant. Default: “tenant_id”.

Returns:

  • (String)

    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_pkString

Returns The name of the primary key column on the tenant model. Default: “id”.

Returns:

  • (String)

    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_tableString

Returns The name of the tenant model table. Default: “tenants”.

Returns:

  • (String)

    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