1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# Require whichever elevator you're using below here...
#
# require 'apartment/elevators/generic'
# require 'apartment/elevators/domain'
# require 'apartment/elevators/subdomain'
#
# Apartment Configuration
#
Apartment.configure do |config|
# These models will not be multi-tenanted,
# but remain in the global (public) namespace
#
# An example might be a Customer or Tenant model that stores each tenant information
# ex:
#
# config.excluded_models = %w{Tenant}
#
config.excluded_models = [
'Api::V1::ApiKey',
'Calendar',
'Chouette::Company',
'Chouette::GroupOfLine',
'Chouette::Line',
'Chouette::Network',
'Chouette::StopArea',
'CleanUp',
'CleanUpResult',
'ComplianceCheck',
'ComplianceCheckBlock',
'ComplianceCheckMessage',
'ComplianceCheckResource',
'ComplianceCheckSet',
'ComplianceControl',
'ComplianceControlBlock',
'ComplianceControlSet',
'CustomField',
'Export::Base',
'Export::Message',
'Export::Resource',
'GenericAttributeControl::MinMax',
'GenericAttributeControl::Pattern',
'GenericAttributeControl::Uniqueness',
'Import::Base',
'Import::Gtfs',
'Import::Message',
'Import::Netex',
'Import::Resource',
'Import::Workbench',
'JourneyPatternControl::Duplicates',
'JourneyPatternControl::VehicleJourney',
'LineControl::Route',
'LineReferential',
'LineReferentialMembership',
'LineReferentialSync',
'LineReferentialSyncMessage',
'Merge',
'Organisation',
'Referential',
'ReferentialCloning',
'ReferentialMetadata',
'ReferentialSuite',
'RouteControl::Duplicates',
'RouteControl::JourneyPattern',
'RouteControl::MinimumLength',
'RouteControl::OmnibusJourneyPattern',
'RouteControl::OppositeRoute',
'RouteControl::OppositeRouteTerminus',
'RouteControl::StopPointsInJourneyPattern',
'RouteControl::UnactivatedStopPoint',
'RouteControl::ZDLStopArea',
'RoutingConstraintZoneControl::MaximumLength',
'RoutingConstraintZoneControl::MinimumLength',
'RoutingConstraintZoneControl::UnactivatedStopPoint',
'SimpleExporter',
'SimpleImporter',
'SimpleInterface',
'StopAreaReferential',
'StopAreaReferentialMembership',
'StopAreaReferentialSync',
'StopAreaReferentialSyncMessage',
'User',
'VehicleJourneyControl::Delta',
'VehicleJourneyControl::Speed',
'VehicleJourneyControl::TimeTable',
'VehicleJourneyControl::VehicleJourneyAtStops',
'VehicleJourneyControl::WaitingTime',
'Workbench',
'Workgroup',
]
# use postgres schemas?
config.use_schemas = true
# use raw SQL dumps for creating postgres schemas? (only appies with use_schemas set to true)
#config.use_sql = true
# configure persistent schemas (E.g. hstore )
config.persistent_schemas = %w{ shared_extensions }
# add the Rails environment to database names?
# config.prepend_environment = true
# config.append_environment = true
# supply list of database names for migrations to run on
config.tenant_names = lambda{ Referential.where(ready: true).order("created_from_id asc").pluck(:slug) }
end
##
# Elevator Configuration
# Rails.application.config.middleware.use 'Apartment::Elevators::Generic', lambda { |request|
# # TODO: supply generic implementation
# }
# Rails.application.config.middleware.use 'Apartment::Elevators::Domain'
# Rails.application.config.middleware.use 'Apartment::Elevators::Subdomain'
|