ros-apartment 2.10.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +256 -59
- data/.ruby-version +1 -1
- data/Appraisals +14 -35
- data/CHANGELOG.md +5 -3
- data/README.md +5 -6
- data/Rakefile +3 -17
- data/lib/apartment/active_record/connection_handling.rb +18 -7
- data/lib/apartment/active_record/postgresql_adapter.rb +43 -0
- data/lib/apartment/active_record/schema_migration.rb +1 -1
- data/lib/apartment/adapters/postgresql_adapter.rb +10 -22
- data/lib/apartment/console.rb +0 -16
- data/lib/apartment/log_subscriber.rb +21 -9
- data/lib/apartment/migrator.rb +3 -21
- data/lib/apartment/railtie.rb +6 -20
- data/lib/apartment/version.rb +1 -1
- data/lib/apartment.rb +6 -16
- data/ros-apartment.gemspec +12 -9
- metadata +24 -38
- data/.circleci/config.yml +0 -76
- data/.github/ISSUE_TEMPLATE.md +0 -21
- data/.github/workflows/changelog.yml +0 -63
- data/.github/workflows/reviewdog.yml +0 -22
- data/.story_branch.yml +0 -5
- data/HISTORY.md +0 -496
- data/TODO.md +0 -50
- data/docker-compose.yml +0 -33
- data/gemfiles/rails_4_2.gemfile +0 -25
- data/gemfiles/rails_5_0.gemfile +0 -23
- data/gemfiles/rails_5_1.gemfile +0 -23
- data/gemfiles/rails_5_2.gemfile +0 -19
- data/gemfiles/rails_6_0.gemfile +0 -23
- data/gemfiles/rails_6_1.gemfile +0 -23
- data/gemfiles/rails_master.gemfile +0 -23
- data/lib/apartment/reloader.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f06dfaa8f3dfb2df11cb16ee69a9d93a6d2d29ea212f8c836aa3df90065beb3
|
4
|
+
data.tar.gz: 3c6c900bfc6227c6725c6b92366460a1949c6f9e3a166971adf4b98a3b5de37f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b9175fc8f056ad74ef2a29d163793b1de9da857d77fe7236458688aec5313501aace5eb78a8ab3583483624c873b9684d083102f3e1defbe54a8385f728fa4
|
7
|
+
data.tar.gz: 6984614b40488003a64d0ffc45bf16ae68d8f348d1771797cb45085c0fcf57a41d05f62661070bcb1ecf3259db2d2fbc8edf998bdc96f23758704efaebb36e25
|
data/.rubocop.yml
CHANGED
@@ -7,6 +7,7 @@ require:
|
|
7
7
|
|
8
8
|
AllCops:
|
9
9
|
Exclude:
|
10
|
+
- vendor/bundle/**/*
|
10
11
|
- gemfiles/**/*.gemfile
|
11
12
|
- gemfiles/vendor/**/*
|
12
13
|
- spec/dummy_engine/dummy_engine.gemspec
|
@@ -30,3 +31,6 @@ Rails/ApplicationRecord:
|
|
30
31
|
|
31
32
|
Rails/Output:
|
32
33
|
Enabled: false
|
34
|
+
|
35
|
+
Style/Documentation:
|
36
|
+
Enabled: false
|
data/.rubocop_todo.yml
CHANGED
@@ -1,24 +1,92 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2024-05-07 18:57:21 UTC using RuboCop version 1.63.4.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 1
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: Severity, Include.
|
12
|
+
# Include: **/*.gemspec
|
13
|
+
Gemspec/DeprecatedAttributeAssignment:
|
14
|
+
Exclude:
|
15
|
+
- 'ros-apartment.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 20
|
18
|
+
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
|
19
|
+
# SupportedStyles: Gemfile, gems.rb, gemspec
|
20
|
+
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
21
|
+
Gemspec/DevelopmentDependencies:
|
22
|
+
Exclude:
|
23
|
+
- 'ros-apartment.gemspec'
|
24
|
+
|
25
|
+
# Offense count: 1
|
26
|
+
# This cop supports safe autocorrection (--autocorrect).
|
27
|
+
# Configuration parameters: Severity, Include.
|
28
|
+
# Include: **/*.gemspec
|
29
|
+
Gemspec/RequireMFA:
|
30
|
+
Exclude:
|
31
|
+
- 'ros-apartment.gemspec'
|
32
|
+
|
33
|
+
# Offense count: 6
|
34
|
+
# This cop supports safe autocorrection (--autocorrect).
|
35
|
+
Layout/EmptyLineAfterMagicComment:
|
36
|
+
Exclude:
|
37
|
+
- 'spec/dummy/config/initializers/backtrace_silencers.rb'
|
38
|
+
- 'spec/dummy/config/initializers/inflections.rb'
|
39
|
+
- 'spec/dummy/config/initializers/mime_types.rb'
|
40
|
+
- 'spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb'
|
41
|
+
- 'spec/dummy_engine/test/dummy/config/initializers/inflections.rb'
|
42
|
+
- 'spec/dummy_engine/test/dummy/config/initializers/mime_types.rb'
|
43
|
+
|
44
|
+
# Offense count: 3
|
45
|
+
# This cop supports safe autocorrection (--autocorrect).
|
46
|
+
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
47
|
+
Layout/LeadingCommentSpace:
|
48
|
+
Exclude:
|
49
|
+
- 'ros-apartment.gemspec'
|
50
|
+
|
51
|
+
# Offense count: 2
|
52
|
+
# This cop supports safe autocorrection (--autocorrect).
|
53
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
54
|
+
# SupportedStyles: aligned, indented
|
55
|
+
Layout/LineEndStringConcatenationIndentation:
|
56
|
+
Exclude:
|
57
|
+
- 'lib/apartment/custom_console.rb'
|
58
|
+
|
59
|
+
# Offense count: 3
|
60
|
+
# This cop supports safe autocorrection (--autocorrect).
|
61
|
+
Layout/SpaceBeforeComment:
|
62
|
+
Exclude:
|
63
|
+
- 'ros-apartment.gemspec'
|
64
|
+
|
9
65
|
# Offense count: 1
|
10
66
|
Lint/MixedRegexpCaptureTypes:
|
11
67
|
Exclude:
|
12
68
|
- 'lib/apartment/elevators/domain.rb'
|
13
69
|
|
14
|
-
# Offense count:
|
15
|
-
#
|
70
|
+
# Offense count: 1
|
71
|
+
# This cop supports safe autocorrection (--autocorrect).
|
72
|
+
Lint/RedundantCopDisableDirective:
|
73
|
+
Exclude:
|
74
|
+
- 'spec/support/config.rb'
|
75
|
+
|
76
|
+
# Offense count: 2
|
77
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
78
|
+
Lint/RedundantDirGlobSort:
|
79
|
+
Exclude:
|
80
|
+
- 'spec/spec_helper.rb'
|
81
|
+
|
82
|
+
# Offense count: 2
|
83
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
16
84
|
Metrics/AbcSize:
|
17
85
|
Max: 28
|
18
86
|
|
19
|
-
# Offense count:
|
20
|
-
# Configuration parameters: CountComments, CountAsOne,
|
21
|
-
#
|
87
|
+
# Offense count: 4
|
88
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
89
|
+
# AllowedMethods: refine
|
22
90
|
Metrics/BlockLength:
|
23
91
|
Max: 83
|
24
92
|
|
@@ -28,26 +96,51 @@ Metrics/ClassLength:
|
|
28
96
|
Max: 151
|
29
97
|
|
30
98
|
# Offense count: 6
|
31
|
-
# Configuration parameters: CountComments, CountAsOne,
|
99
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
32
100
|
Metrics/MethodLength:
|
33
|
-
Max:
|
101
|
+
Max: 23
|
102
|
+
|
103
|
+
# Offense count: 3
|
104
|
+
# This cop supports safe autocorrection (--autocorrect).
|
105
|
+
# Configuration parameters: EnforcedStyle, BlockForwardingName.
|
106
|
+
# SupportedStyles: anonymous, explicit
|
107
|
+
Naming/BlockForwarding:
|
108
|
+
Exclude:
|
109
|
+
- 'lib/apartment/adapters/abstract_adapter.rb'
|
110
|
+
- 'lib/apartment/log_subscriber.rb'
|
111
|
+
|
112
|
+
# Offense count: 1
|
113
|
+
# This cop supports safe autocorrection (--autocorrect).
|
114
|
+
Performance/RedundantBlockCall:
|
115
|
+
Exclude:
|
116
|
+
- 'lib/apartment/tasks/task_helper.rb'
|
117
|
+
|
118
|
+
# Offense count: 1
|
119
|
+
# This cop supports safe autocorrection (--autocorrect).
|
120
|
+
Performance/StringIdentifierArgument:
|
121
|
+
Exclude:
|
122
|
+
- 'lib/apartment/railtie.rb'
|
34
123
|
|
35
124
|
# Offense count: 3
|
36
125
|
RSpec/AnyInstance:
|
37
126
|
Exclude:
|
38
127
|
- 'spec/unit/migrator_spec.rb'
|
39
128
|
|
129
|
+
# Offense count: 4
|
130
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
131
|
+
RSpec/BeEq:
|
132
|
+
Exclude:
|
133
|
+
- 'spec/adapters/sqlite3_adapter_spec.rb'
|
134
|
+
- 'spec/unit/elevators/first_subdomain_spec.rb'
|
135
|
+
|
40
136
|
# Offense count: 2
|
41
137
|
RSpec/BeforeAfterAll:
|
42
138
|
Exclude:
|
43
|
-
- 'spec/spec_helper.rb'
|
44
|
-
- 'spec/rails_helper.rb'
|
45
|
-
- 'spec/support/**/*.rb'
|
46
139
|
- 'spec/adapters/sqlite3_adapter_spec.rb'
|
47
140
|
- 'spec/tasks/apartment_rake_spec.rb'
|
48
141
|
|
49
142
|
# Offense count: 18
|
50
|
-
# Configuration parameters: Prefixes.
|
143
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
51
144
|
# Prefixes: when, with, without
|
52
145
|
RSpec/ContextWording:
|
53
146
|
Exclude:
|
@@ -58,18 +151,19 @@ RSpec/ContextWording:
|
|
58
151
|
- 'spec/tasks/apartment_rake_spec.rb'
|
59
152
|
- 'spec/tenant_spec.rb'
|
60
153
|
|
61
|
-
# Offense count:
|
154
|
+
# Offense count: 5
|
62
155
|
# Configuration parameters: IgnoredMetadata.
|
63
156
|
RSpec/DescribeClass:
|
64
157
|
Exclude:
|
65
158
|
- 'spec/integration/apartment_rake_integration_spec.rb'
|
159
|
+
- 'spec/integration/connection_handling_spec.rb'
|
66
160
|
- 'spec/integration/query_caching_spec.rb'
|
67
161
|
- 'spec/integration/use_within_an_engine_spec.rb'
|
68
162
|
- 'spec/tasks/apartment_rake_spec.rb'
|
69
163
|
|
70
|
-
# Offense count:
|
71
|
-
#
|
72
|
-
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
164
|
+
# Offense count: 6
|
165
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
166
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
73
167
|
# SupportedStyles: described_class, explicit
|
74
168
|
RSpec/DescribedClass:
|
75
169
|
Exclude:
|
@@ -77,28 +171,23 @@ RSpec/DescribedClass:
|
|
77
171
|
- 'spec/tenant_spec.rb'
|
78
172
|
- 'spec/unit/elevators/host_hash_spec.rb'
|
79
173
|
- 'spec/unit/migrator_spec.rb'
|
80
|
-
- 'spec/unit/reloader_spec.rb'
|
81
174
|
|
82
175
|
# Offense count: 5
|
83
|
-
#
|
176
|
+
# This cop supports safe autocorrection (--autocorrect).
|
84
177
|
RSpec/EmptyLineAfterFinalLet:
|
85
178
|
Exclude:
|
86
179
|
- 'spec/adapters/sqlite3_adapter_spec.rb'
|
87
180
|
- 'spec/examples/schema_adapter_examples.rb'
|
88
181
|
|
89
182
|
# Offense count: 14
|
90
|
-
# Configuration parameters:
|
183
|
+
# Configuration parameters: CountAsOne.
|
91
184
|
RSpec/ExampleLength:
|
92
|
-
|
93
|
-
- 'spec/examples/generic_adapter_custom_configuration_example.rb'
|
94
|
-
- 'spec/examples/generic_adapter_examples.rb'
|
95
|
-
- 'spec/examples/schema_adapter_examples.rb'
|
96
|
-
- 'spec/integration/query_caching_spec.rb'
|
97
|
-
- 'spec/tenant_spec.rb'
|
185
|
+
Max: 12
|
98
186
|
|
99
|
-
# Offense count:
|
100
|
-
#
|
101
|
-
# Configuration parameters: CustomTransform, IgnoredWords.
|
187
|
+
# Offense count: 58
|
188
|
+
# This cop supports safe autocorrection (--autocorrect).
|
189
|
+
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
|
190
|
+
# DisallowedExamples: works
|
102
191
|
RSpec/ExampleWording:
|
103
192
|
Exclude:
|
104
193
|
- 'spec/adapters/sqlite3_adapter_spec.rb'
|
@@ -112,8 +201,9 @@ RSpec/ExampleWording:
|
|
112
201
|
- 'spec/tasks/apartment_rake_spec.rb'
|
113
202
|
- 'spec/tenant_spec.rb'
|
114
203
|
|
115
|
-
# Offense count:
|
116
|
-
# Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
204
|
+
# Offense count: 12
|
205
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
206
|
+
# Include: **/*_spec*rb*, **/spec/**/*
|
117
207
|
RSpec/FilePath:
|
118
208
|
Exclude:
|
119
209
|
- 'spec/adapters/mysql2_adapter_spec.rb'
|
@@ -128,10 +218,9 @@ RSpec/FilePath:
|
|
128
218
|
- 'spec/unit/elevators/host_spec.rb'
|
129
219
|
- 'spec/unit/elevators/subdomain_spec.rb'
|
130
220
|
- 'spec/unit/migrator_spec.rb'
|
131
|
-
- 'spec/unit/reloader_spec.rb'
|
132
221
|
|
133
222
|
# Offense count: 1
|
134
|
-
#
|
223
|
+
# This cop supports safe autocorrection (--autocorrect).
|
135
224
|
# Configuration parameters: EnforcedStyle.
|
136
225
|
# SupportedStyles: implicit, each, example
|
137
226
|
RSpec/HookArgument:
|
@@ -139,13 +228,20 @@ RSpec/HookArgument:
|
|
139
228
|
- 'spec/support/setup.rb'
|
140
229
|
|
141
230
|
# Offense count: 4
|
142
|
-
#
|
231
|
+
# This cop supports safe autocorrection (--autocorrect).
|
143
232
|
RSpec/HooksBeforeExamples:
|
144
233
|
Exclude:
|
145
234
|
- 'spec/adapters/sqlite3_adapter_spec.rb'
|
146
235
|
- 'spec/examples/schema_adapter_examples.rb'
|
147
236
|
|
148
|
-
# Offense count:
|
237
|
+
# Offense count: 4
|
238
|
+
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
239
|
+
RSpec/IndexedLet:
|
240
|
+
Exclude:
|
241
|
+
- 'spec/examples/schema_adapter_examples.rb'
|
242
|
+
- 'spec/support/contexts.rb'
|
243
|
+
|
244
|
+
# Offense count: 16
|
149
245
|
# Configuration parameters: AssignmentOnly.
|
150
246
|
RSpec/InstanceVariable:
|
151
247
|
Exclude:
|
@@ -155,19 +251,13 @@ RSpec/InstanceVariable:
|
|
155
251
|
- 'spec/integration/use_within_an_engine_spec.rb'
|
156
252
|
- 'spec/tasks/apartment_rake_spec.rb'
|
157
253
|
|
158
|
-
# Offense count: 1
|
159
|
-
# Cop supports --auto-correct.
|
160
|
-
RSpec/LeadingSubject:
|
161
|
-
Exclude:
|
162
|
-
- 'spec/unit/reloader_spec.rb'
|
163
|
-
|
164
254
|
# Offense count: 2
|
165
255
|
RSpec/LeakyConstantDeclaration:
|
166
256
|
Exclude:
|
167
257
|
- 'spec/examples/generic_adapters_callbacks_examples.rb'
|
168
258
|
- 'spec/unit/elevators/generic_spec.rb'
|
169
259
|
|
170
|
-
# Offense count:
|
260
|
+
# Offense count: 27
|
171
261
|
# Configuration parameters: EnforcedStyle.
|
172
262
|
# SupportedStyles: have_received, receive
|
173
263
|
RSpec/MessageSpies:
|
@@ -183,12 +273,22 @@ RSpec/MessageSpies:
|
|
183
273
|
- 'spec/unit/elevators/subdomain_spec.rb'
|
184
274
|
- 'spec/unit/migrator_spec.rb'
|
185
275
|
|
186
|
-
# Offense count:
|
276
|
+
# Offense count: 11
|
277
|
+
# This cop supports safe autocorrection (--autocorrect).
|
278
|
+
# Configuration parameters: EnforcedStyle.
|
279
|
+
# SupportedStyles: hash, symbol
|
280
|
+
RSpec/MetadataStyle:
|
281
|
+
Exclude:
|
282
|
+
- 'spec/examples/schema_adapter_examples.rb'
|
283
|
+
- 'spec/support/contexts.rb'
|
284
|
+
|
285
|
+
# Offense count: 27
|
187
286
|
RSpec/MultipleExpectations:
|
188
|
-
Max:
|
287
|
+
Max: 6
|
189
288
|
|
190
|
-
# Offense count:
|
191
|
-
# Configuration parameters: IgnoreSharedExamples.
|
289
|
+
# Offense count: 46
|
290
|
+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
291
|
+
# SupportedStyles: always, named_only
|
192
292
|
RSpec/NamedSubject:
|
193
293
|
Exclude:
|
194
294
|
- 'spec/adapters/mysql2_adapter_spec.rb'
|
@@ -196,34 +296,70 @@ RSpec/NamedSubject:
|
|
196
296
|
- 'spec/support/contexts.rb'
|
197
297
|
- 'spec/support/requirements.rb'
|
198
298
|
- 'spec/tenant_spec.rb'
|
199
|
-
- 'spec/unit/reloader_spec.rb'
|
200
299
|
|
201
|
-
# Offense count:
|
300
|
+
# Offense count: 22
|
301
|
+
# Configuration parameters: AllowedGroups.
|
202
302
|
RSpec/NestedGroups:
|
203
303
|
Max: 5
|
204
304
|
|
205
|
-
# Offense count:
|
206
|
-
#
|
207
|
-
#
|
208
|
-
|
209
|
-
RSpec/ReturnFromStub:
|
305
|
+
# Offense count: 1
|
306
|
+
# Configuration parameters: AllowedPatterns.
|
307
|
+
# AllowedPatterns: ^expect_, ^assert_
|
308
|
+
RSpec/NoExpectationExample:
|
210
309
|
Exclude:
|
211
|
-
- 'spec/
|
310
|
+
- 'spec/tenant_spec.rb'
|
311
|
+
|
312
|
+
# Offense count: 12
|
313
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
314
|
+
# Include: **/*_spec.rb
|
315
|
+
RSpec/SpecFilePathFormat:
|
316
|
+
Exclude:
|
317
|
+
- 'spec/adapters/mysql2_adapter_spec.rb'
|
318
|
+
- 'spec/adapters/postgresql_adapter_spec.rb'
|
319
|
+
- 'spec/adapters/sqlite3_adapter_spec.rb'
|
320
|
+
- 'spec/tenant_spec.rb'
|
321
|
+
- 'spec/unit/config_spec.rb'
|
322
|
+
- 'spec/unit/elevators/domain_spec.rb'
|
323
|
+
- 'spec/unit/elevators/first_subdomain_spec.rb'
|
324
|
+
- 'spec/unit/elevators/generic_spec.rb'
|
325
|
+
- 'spec/unit/elevators/host_hash_spec.rb'
|
326
|
+
- 'spec/unit/elevators/host_spec.rb'
|
327
|
+
- 'spec/unit/elevators/subdomain_spec.rb'
|
212
328
|
- 'spec/unit/migrator_spec.rb'
|
213
329
|
|
214
|
-
# Offense count:
|
330
|
+
# Offense count: 2
|
215
331
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
216
332
|
RSpec/VerifiedDoubles:
|
217
333
|
Exclude:
|
218
334
|
- 'spec/integration/apartment_rake_integration_spec.rb'
|
219
335
|
- 'spec/unit/elevators/first_subdomain_spec.rb'
|
220
|
-
- 'spec/unit/reloader_spec.rb'
|
221
336
|
|
222
|
-
# Offense count:
|
337
|
+
# Offense count: 2
|
338
|
+
# This cop supports safe autocorrection (--autocorrect).
|
339
|
+
Rails/IndexWith:
|
340
|
+
Exclude:
|
341
|
+
- 'lib/apartment.rb'
|
342
|
+
- 'spec/unit/config_spec.rb'
|
343
|
+
|
344
|
+
# Offense count: 7
|
345
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
346
|
+
Rails/Pluck:
|
347
|
+
Exclude:
|
348
|
+
- 'spec/adapters/jdbc_mysql_adapter_spec.rb'
|
349
|
+
- 'spec/adapters/jdbc_postgresql_adapter_spec.rb'
|
350
|
+
- 'spec/adapters/mysql2_adapter_spec.rb'
|
351
|
+
- 'spec/adapters/postgresql_adapter_spec.rb'
|
352
|
+
|
353
|
+
# Offense count: 1
|
354
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
355
|
+
Security/IoMethods:
|
356
|
+
Exclude:
|
357
|
+
- 'spec/support/config.rb'
|
358
|
+
|
359
|
+
# Offense count: 16
|
360
|
+
# Configuration parameters: AllowedConstants.
|
223
361
|
Style/Documentation:
|
224
362
|
Exclude:
|
225
|
-
- 'spec/**/*'
|
226
|
-
- 'test/**/*'
|
227
363
|
- 'lib/apartment/adapters/jdbc_mysql_adapter.rb'
|
228
364
|
- 'lib/apartment/adapters/postgis_adapter.rb'
|
229
365
|
- 'lib/apartment/adapters/postgresql_adapter.rb'
|
@@ -233,7 +369,68 @@ Style/Documentation:
|
|
233
369
|
- 'lib/apartment/migrator.rb'
|
234
370
|
- 'lib/apartment/model.rb'
|
235
371
|
- 'lib/apartment/railtie.rb'
|
236
|
-
- 'lib/apartment/reloader.rb'
|
237
372
|
- 'lib/apartment/tasks/enhancements.rb'
|
238
373
|
- 'lib/apartment/tasks/task_helper.rb'
|
239
374
|
- 'lib/generators/apartment/install/install_generator.rb'
|
375
|
+
|
376
|
+
# Offense count: 4
|
377
|
+
# This cop supports safe autocorrection (--autocorrect).
|
378
|
+
# Configuration parameters: AllowedVars.
|
379
|
+
Style/FetchEnvVar:
|
380
|
+
Exclude:
|
381
|
+
- 'lib/apartment/adapters/postgresql_adapter.rb'
|
382
|
+
|
383
|
+
# Offense count: 3
|
384
|
+
# This cop supports safe autocorrection (--autocorrect).
|
385
|
+
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
386
|
+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
387
|
+
# SupportedShorthandSyntax: always, never, either, consistent
|
388
|
+
Style/HashSyntax:
|
389
|
+
Exclude:
|
390
|
+
- 'lib/apartment/active_record/connection_handling.rb'
|
391
|
+
- 'spec/integration/connection_handling_spec.rb'
|
392
|
+
|
393
|
+
# Offense count: 1
|
394
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
395
|
+
# Configuration parameters: EnforcedStyle, Autocorrect.
|
396
|
+
# SupportedStyles: module_function, extend_self, forbidden
|
397
|
+
Style/ModuleFunction:
|
398
|
+
Exclude:
|
399
|
+
- 'lib/apartment/migrator.rb'
|
400
|
+
|
401
|
+
# Offense count: 4
|
402
|
+
# This cop supports safe autocorrection (--autocorrect).
|
403
|
+
Style/RedundantConstantBase:
|
404
|
+
Exclude:
|
405
|
+
- 'spec/apartment_spec.rb'
|
406
|
+
- 'spec/dummy/config.ru'
|
407
|
+
- 'spec/dummy_engine/test/dummy/config.ru'
|
408
|
+
- 'spec/dummy_engine/test/dummy/config/environments/production.rb'
|
409
|
+
|
410
|
+
# Offense count: 1
|
411
|
+
# This cop supports safe autocorrection (--autocorrect).
|
412
|
+
Style/RedundantParentheses:
|
413
|
+
Exclude:
|
414
|
+
- 'lib/apartment.rb'
|
415
|
+
|
416
|
+
# Offense count: 1
|
417
|
+
# This cop supports safe autocorrection (--autocorrect).
|
418
|
+
Style/RedundantRegexpArgument:
|
419
|
+
Exclude:
|
420
|
+
- 'lib/apartment/tasks/enhancements.rb'
|
421
|
+
|
422
|
+
# Offense count: 3
|
423
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
424
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
425
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
426
|
+
Style/SafeNavigation:
|
427
|
+
Exclude:
|
428
|
+
- 'lib/apartment/migrator.rb'
|
429
|
+
- 'lib/tasks/apartment.rake'
|
430
|
+
|
431
|
+
# Offense count: 2
|
432
|
+
# This cop supports safe autocorrection (--autocorrect).
|
433
|
+
Style/SuperWithArgsParentheses:
|
434
|
+
Exclude:
|
435
|
+
- 'lib/apartment/adapters/sqlite3_adapter.rb'
|
436
|
+
- 'lib/apartment/elevators/host_hash.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.4
|
data/Appraisals
CHANGED
@@ -1,54 +1,33 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise 'rails-
|
4
|
-
gem 'rails', '~>
|
5
|
-
platforms :ruby do
|
6
|
-
gem 'pg', '< 1.0.0'
|
7
|
-
end
|
8
|
-
platforms :jruby do
|
9
|
-
gem 'activerecord-jdbc-adapter', '~> 50.0'
|
10
|
-
gem 'activerecord-jdbcpostgresql-adapter', '~> 50.0'
|
11
|
-
gem 'activerecord-jdbcmysql-adapter', '~> 50.0'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
appraise 'rails-5-1' do
|
16
|
-
gem 'rails', '~> 5.1.0'
|
3
|
+
appraise 'rails-6-1' do
|
4
|
+
gem 'rails', '~> 6.1.0'
|
17
5
|
platforms :ruby do
|
18
|
-
gem '
|
19
|
-
end
|
20
|
-
platforms :jruby do
|
21
|
-
gem 'activerecord-jdbc-adapter', '~> 51.0'
|
22
|
-
gem 'activerecord-jdbcpostgresql-adapter', '~> 51.0'
|
23
|
-
gem 'activerecord-jdbcmysql-adapter', '~> 51.0'
|
6
|
+
gem 'sqlite3', '~> 1.4'
|
24
7
|
end
|
25
|
-
end
|
26
|
-
|
27
|
-
appraise 'rails-5-2' do
|
28
|
-
gem 'rails', '~> 5.2.0'
|
29
8
|
platforms :jruby do
|
30
|
-
gem 'activerecord-jdbc-adapter', '~>
|
31
|
-
gem 'activerecord-jdbcpostgresql-adapter', '~>
|
32
|
-
gem 'activerecord-jdbcmysql-adapter', '~>
|
9
|
+
gem 'activerecord-jdbc-adapter', '~> 61.0'
|
10
|
+
gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
|
11
|
+
gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
|
33
12
|
end
|
34
13
|
end
|
35
14
|
|
36
|
-
appraise 'rails-
|
37
|
-
gem 'rails', '~>
|
15
|
+
appraise 'rails-7-0' do
|
16
|
+
gem 'rails', '~> 7.0.0'
|
38
17
|
platforms :ruby do
|
39
18
|
gem 'sqlite3', '~> 1.4'
|
40
19
|
end
|
41
20
|
platforms :jruby do
|
42
|
-
gem 'activerecord-jdbc-adapter', '~>
|
43
|
-
gem 'activerecord-jdbcpostgresql-adapter', '~>
|
44
|
-
gem 'activerecord-jdbcmysql-adapter', '~>
|
21
|
+
gem 'activerecord-jdbc-adapter', '~> 61.0'
|
22
|
+
gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
|
23
|
+
gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
|
45
24
|
end
|
46
25
|
end
|
47
26
|
|
48
|
-
appraise 'rails-
|
49
|
-
gem 'rails', '~>
|
27
|
+
appraise 'rails-7-1' do
|
28
|
+
gem 'rails', '~> 7.1.0'
|
50
29
|
platforms :ruby do
|
51
|
-
gem 'sqlite3', '~> 1.
|
30
|
+
gem 'sqlite3', '~> 1.6'
|
52
31
|
end
|
53
32
|
platforms :jruby do
|
54
33
|
gem 'activerecord-jdbc-adapter', '~> 61.0'
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
# Changelog
|
1
|
+
# Changelog [DEPRECATED]
|
2
2
|
|
3
|
-
|
3
|
+
Changes are now being tracked in the [releases](https://github.com/rails-on-services/apartment/releases) section of the repository.
|
4
4
|
|
5
|
-
[
|
5
|
+
## [v2.8.1](https://github.com/rails-on-services/apartment/tree/v2.8.1) (2020-12-17)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.8.0...v2.8.1)
|
6
8
|
|
7
9
|
**Implemented enhancements:**
|
8
10
|
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Apartment
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/ros-apartment.svg)](https://badge.fury.io/rb/apartment)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/ros-apartment.svg)](https://badge.fury.io/rb/ros-apartment)
|
4
4
|
[![Code Climate](https://api.codeclimate.com/v1/badges/b0dc327380bb8438f991/maintainability)](https://codeclimate.com/github/rails-on-services/apartment/maintainability)
|
5
|
-
[![Build Status](https://travis-ci.org/rails-on-services/apartment.svg?branch=development)](https://travis-ci.org/rails-on-services/apartment)
|
6
5
|
|
7
6
|
*Multitenancy for Rails and ActiveRecord*
|
8
7
|
|
@@ -68,7 +67,7 @@ you need to create a new tenant, you can run the following command:
|
|
68
67
|
Apartment::Tenant.create('tenant_name')
|
69
68
|
```
|
70
69
|
|
71
|
-
If you're using the [prepend environment](https://github.com/
|
70
|
+
If you're using the [prepend environment](https://github.com/rails-on-services/apartment#handling-environments) config option or you AREN'T using Postgresql Schemas, this will create a tenant in the following format: "#{environment}\_tenant_name".
|
72
71
|
In the case of a sqlite database, this will be created in your 'db/' folder. With
|
73
72
|
other databases, the tenant will be created as a new DB within the system.
|
74
73
|
|
@@ -275,7 +274,7 @@ In the examples above, we show the Apartment middleware being appended to the Ra
|
|
275
274
|
Rails.application.config.middleware.use Apartment::Elevators::Subdomain
|
276
275
|
```
|
277
276
|
|
278
|
-
By default, the Subdomain middleware switches into a Tenant based on the subdomain at the beginning of the request, and when the request is finished, it switches back to the "public" Tenant. This happens in the [Generic](https://github.com/
|
277
|
+
By default, the Subdomain middleware switches into a Tenant based on the subdomain at the beginning of the request, and when the request is finished, it switches back to the "public" Tenant. This happens in the [Generic](https://github.com/rails-on-services/apartment/blob/development/lib/apartment/elevators/generic.rb#L22) elevator, so all elevators that inherit from this elevator will operate as such.
|
279
278
|
|
280
279
|
It's also good to note that Apartment switches back to the "public" tenant any time an error is raised in your application.
|
281
280
|
|
@@ -344,7 +343,7 @@ Setting this configuration value to `false` will disable the schema presence che
|
|
344
343
|
|
345
344
|
```ruby
|
346
345
|
Apartment.configure do |config|
|
347
|
-
tenant_presence_check = false
|
346
|
+
config.tenant_presence_check = false
|
348
347
|
end
|
349
348
|
```
|
350
349
|
|
@@ -531,7 +530,7 @@ You can then migrate your tenants using the normal rake task:
|
|
531
530
|
rake db:migrate
|
532
531
|
```
|
533
532
|
|
534
|
-
This just invokes `Apartment::
|
533
|
+
This just invokes `Apartment::Migrator.migrate(#{tenant_name})` for each tenant name supplied
|
535
534
|
from `Apartment.tenant_names`
|
536
535
|
|
537
536
|
Note that you can disable the default migrating of all tenants with `db:migrate` by setting
|
data/Rakefile
CHANGED
@@ -132,22 +132,8 @@ def my_config
|
|
132
132
|
config['mysql']
|
133
133
|
end
|
134
134
|
|
135
|
-
def activerecord_below_5_2?
|
136
|
-
ActiveRecord.version.release < Gem::Version.new('5.2.0')
|
137
|
-
end
|
138
|
-
|
139
|
-
def activerecord_below_6_0?
|
140
|
-
ActiveRecord.version.release < Gem::Version.new('6.0.0')
|
141
|
-
end
|
142
|
-
|
143
135
|
def migrate
|
144
|
-
if
|
145
|
-
|
146
|
-
|
147
|
-
ActiveRecord::MigrationContext.new('spec/dummy/db/migrate').migrate
|
148
|
-
else
|
149
|
-
# TODO: Figure out if there is any other possibility that can/should be
|
150
|
-
# passed here as the second argument for the migration context
|
151
|
-
ActiveRecord::MigrationContext.new('spec/dummy/db/migrate', ActiveRecord::SchemaMigration).migrate
|
152
|
-
end
|
136
|
+
# TODO: Figure out if there is any other possibility that can/should be
|
137
|
+
# passed here as the second argument for the migration context
|
138
|
+
ActiveRecord::MigrationContext.new('spec/dummy/db/migrate', ActiveRecord::SchemaMigration).migrate
|
153
139
|
end
|