ros-apartment 2.8.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +20 -80
- data/.rubocop_todo.yml +393 -20
- data/.ruby-version +1 -0
- data/Appraisals +30 -38
- data/CHANGELOG.md +5 -3
- data/Gemfile +0 -8
- data/README.md +15 -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/jdbc_postgresql_adapter.rb +2 -4
- data/lib/apartment/adapters/postgresql_adapter.rb +19 -26
- data/lib/apartment/adapters/trilogy_adapter.rb +29 -0
- 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/model.rb +3 -1
- data/lib/apartment/railtie.rb +7 -23
- data/lib/apartment/tasks/task_helper.rb +12 -0
- data/lib/apartment/version.rb +1 -1
- data/lib/apartment.rb +24 -19
- data/lib/tasks/apartment.rake +23 -39
- data/ros-apartment.gemspec +25 -13
- metadata +132 -41
- data/.circleci/config.yml +0 -78
- data/.github/ISSUE_TEMPLATE.md +0 -21
- data/.github/workflows/changelog.yml +0 -63
- 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_master.gemfile +0 -23
- data/lib/apartment/reloader.rb +0 -22
data/lib/tasks/apartment.rake
CHANGED
@@ -17,12 +17,10 @@ apartment_namespace = namespace :apartment do
|
|
17
17
|
desc 'Drop all tenants'
|
18
18
|
task :drop do
|
19
19
|
Apartment::TaskHelper.tenants.each do |tenant|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
puts e.message
|
25
|
-
end
|
20
|
+
puts("Dropping #{tenant} tenant")
|
21
|
+
Apartment::Tenant.drop(tenant)
|
22
|
+
rescue Apartment::TenantNotFound, ActiveRecord::NoDatabaseError => e
|
23
|
+
puts e.message
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
@@ -30,13 +28,7 @@ apartment_namespace = namespace :apartment do
|
|
30
28
|
task :migrate do
|
31
29
|
Apartment::TaskHelper.warn_if_tenants_empty
|
32
30
|
Apartment::TaskHelper.each_tenant do |tenant|
|
33
|
-
|
34
|
-
Apartment::TaskHelper.create_tenant(tenant)
|
35
|
-
puts("Migrating #{tenant} tenant")
|
36
|
-
Apartment::Migrator.migrate tenant
|
37
|
-
rescue Apartment::TenantNotFound => e
|
38
|
-
puts e.message
|
39
|
-
end
|
31
|
+
Apartment::TaskHelper.migrate_tenant(tenant)
|
40
32
|
end
|
41
33
|
end
|
42
34
|
|
@@ -45,15 +37,13 @@ apartment_namespace = namespace :apartment do
|
|
45
37
|
Apartment::TaskHelper.warn_if_tenants_empty
|
46
38
|
|
47
39
|
Apartment::TaskHelper.each_tenant do |tenant|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
Apartment::Tenant.
|
52
|
-
Apartment::Tenant.seed
|
53
|
-
end
|
54
|
-
rescue Apartment::TenantNotFound => e
|
55
|
-
puts e.message
|
40
|
+
Apartment::TaskHelper.create_tenant(tenant)
|
41
|
+
puts("Seeding #{tenant} tenant")
|
42
|
+
Apartment::Tenant.switch(tenant) do
|
43
|
+
Apartment::Tenant.seed
|
56
44
|
end
|
45
|
+
rescue Apartment::TenantNotFound => e
|
46
|
+
puts e.message
|
57
47
|
end
|
58
48
|
end
|
59
49
|
|
@@ -64,12 +54,10 @@ apartment_namespace = namespace :apartment do
|
|
64
54
|
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
65
55
|
|
66
56
|
Apartment::TaskHelper.each_tenant do |tenant|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
puts e.message
|
72
|
-
end
|
57
|
+
puts("Rolling back #{tenant} tenant")
|
58
|
+
Apartment::Migrator.rollback tenant, step
|
59
|
+
rescue Apartment::TenantNotFound => e
|
60
|
+
puts e.message
|
73
61
|
end
|
74
62
|
end
|
75
63
|
|
@@ -82,12 +70,10 @@ apartment_namespace = namespace :apartment do
|
|
82
70
|
raise 'VERSION is required' unless version
|
83
71
|
|
84
72
|
Apartment::TaskHelper.each_tenant do |tenant|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
puts e.message
|
90
|
-
end
|
73
|
+
puts("Migrating #{tenant} tenant up")
|
74
|
+
Apartment::Migrator.run :up, tenant, version
|
75
|
+
rescue Apartment::TenantNotFound => e
|
76
|
+
puts e.message
|
91
77
|
end
|
92
78
|
end
|
93
79
|
|
@@ -99,12 +85,10 @@ apartment_namespace = namespace :apartment do
|
|
99
85
|
raise 'VERSION is required' unless version
|
100
86
|
|
101
87
|
Apartment::TaskHelper.each_tenant do |tenant|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
puts e.message
|
107
|
-
end
|
88
|
+
puts("Migrating #{tenant} tenant down")
|
89
|
+
Apartment::Migrator.run :down, tenant, version
|
90
|
+
rescue Apartment::TenantNotFound => e
|
91
|
+
puts e.message
|
108
92
|
end
|
109
93
|
end
|
110
94
|
|
data/ros-apartment.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
18
|
`git ls-files -z`.split("\x0").reject do |f|
|
19
19
|
# NOTE: ignore all test related
|
20
|
-
f.match(%r{^(test|spec|features|documentation)/})
|
20
|
+
f.match(%r{^(test|spec|features|documentation|gemfiles|.github)/})
|
21
21
|
end
|
22
22
|
end
|
23
23
|
s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
@@ -26,18 +26,29 @@ Gem::Specification.new do |s|
|
|
26
26
|
|
27
27
|
s.homepage = 'https://github.com/rails-on-services/apartment'
|
28
28
|
s.licenses = ['MIT']
|
29
|
+
s.metadata = {
|
30
|
+
'github_repo' => 'ssh://github.com/rails-on-services/apartment'
|
31
|
+
}
|
29
32
|
|
30
|
-
s.
|
31
|
-
s.add_dependency 'parallel', '< 2.0'
|
32
|
-
s.add_dependency 'public_suffix', '>= 2.0.5', '< 5.0'
|
33
|
-
s.add_dependency 'rack', '>= 1.3.6', '< 3.0'
|
33
|
+
s.required_ruby_version = '>= 3.0', '< 3.4'
|
34
34
|
|
35
|
-
s.
|
36
|
-
s.
|
37
|
-
s.
|
38
|
-
s.
|
39
|
-
|
40
|
-
s.add_development_dependency '
|
35
|
+
s.add_dependency 'activerecord', '>= 6.1.0', '< 7.2'
|
36
|
+
s.add_dependency 'parallel', '< 2.0'
|
37
|
+
s.add_dependency 'public_suffix', '>= 2.0.5', '< 6.0'
|
38
|
+
s.add_dependency 'rack', '>= 1.3.6', '< 4.0'
|
39
|
+
|
40
|
+
s.add_development_dependency 'appraisal', '~> 2.2'
|
41
|
+
s.add_development_dependency 'bundler', '>= 1.3', '< 3.0'
|
42
|
+
s.add_development_dependency 'guard-rspec', '~> 4.2'
|
43
|
+
s.add_development_dependency 'pry'
|
44
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
45
|
+
s.add_development_dependency 'rspec', '~> 3.4'
|
46
|
+
s.add_development_dependency 'rspec_junit_formatter'
|
47
|
+
s.add_development_dependency 'rspec-rails', '~> 6.1'
|
48
|
+
s.add_development_dependency 'rubocop', '~> 1.63'
|
49
|
+
s.add_development_dependency 'rubocop-performance', '~> 1.21'
|
50
|
+
s.add_development_dependency 'rubocop-rails', '~> 2.24'
|
51
|
+
s.add_development_dependency 'rubocop-rspec', '~> 2.29'
|
41
52
|
|
42
53
|
if defined?(JRUBY_VERSION)
|
43
54
|
s.add_development_dependency 'activerecord-jdbc-adapter'
|
@@ -47,7 +58,8 @@ Gem::Specification.new do |s|
|
|
47
58
|
s.add_development_dependency 'jdbc-postgres'
|
48
59
|
else
|
49
60
|
s.add_development_dependency 'mysql2', '~> 0.5'
|
50
|
-
s.add_development_dependency 'pg', '~> 1.
|
51
|
-
s.add_development_dependency 'sqlite3', '
|
61
|
+
s.add_development_dependency 'pg', '~> 1.5'
|
62
|
+
s.add_development_dependency 'sqlite3', '< 2.0'
|
63
|
+
s.add_development_dependency 'trilogy', '< 3.0'
|
52
64
|
end
|
53
65
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ros-apartment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brunner
|
8
8
|
- Brad Robertson
|
9
9
|
- Rui Baltazar
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -18,20 +18,20 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 6.1.0
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: '
|
24
|
+
version: '7.2'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
31
|
+
version: 6.1.0
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '7.2'
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: parallel
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: 2.0.5
|
56
56
|
- - "<"
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version: '
|
58
|
+
version: '6.0'
|
59
59
|
type: :runtime
|
60
60
|
prerelease: false
|
61
61
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 2.0.5
|
66
66
|
- - "<"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '6.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,7 +75,7 @@ dependencies:
|
|
75
75
|
version: 1.3.6
|
76
76
|
- - "<"
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: '
|
78
|
+
version: '4.0'
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -85,7 +85,7 @@ dependencies:
|
|
85
85
|
version: 1.3.6
|
86
86
|
- - "<"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '4.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: appraisal
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,19 +121,33 @@ dependencies:
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '3.0'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
124
|
+
name: guard-rspec
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
127
|
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '2
|
129
|
+
version: '4.2'
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '2
|
136
|
+
version: '4.2'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: pry
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
137
151
|
- !ruby/object:Gem::Dependency
|
138
152
|
name: rake
|
139
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,20 +176,90 @@ dependencies:
|
|
162
176
|
- - "~>"
|
163
177
|
- !ruby/object:Gem::Version
|
164
178
|
version: '3.4'
|
179
|
+
- !ruby/object:Gem::Dependency
|
180
|
+
name: rspec_junit_formatter
|
181
|
+
requirement: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
type: :development
|
187
|
+
prerelease: false
|
188
|
+
version_requirements: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
165
193
|
- !ruby/object:Gem::Dependency
|
166
194
|
name: rspec-rails
|
167
195
|
requirement: !ruby/object:Gem::Requirement
|
168
196
|
requirements:
|
169
197
|
- - "~>"
|
170
198
|
- !ruby/object:Gem::Version
|
171
|
-
version: '
|
199
|
+
version: '6.1'
|
172
200
|
type: :development
|
173
201
|
prerelease: false
|
174
202
|
version_requirements: !ruby/object:Gem::Requirement
|
175
203
|
requirements:
|
176
204
|
- - "~>"
|
177
205
|
- !ruby/object:Gem::Version
|
178
|
-
version: '
|
206
|
+
version: '6.1'
|
207
|
+
- !ruby/object:Gem::Dependency
|
208
|
+
name: rubocop
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - "~>"
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '1.63'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - "~>"
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: '1.63'
|
221
|
+
- !ruby/object:Gem::Dependency
|
222
|
+
name: rubocop-performance
|
223
|
+
requirement: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - "~>"
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '1.21'
|
228
|
+
type: :development
|
229
|
+
prerelease: false
|
230
|
+
version_requirements: !ruby/object:Gem::Requirement
|
231
|
+
requirements:
|
232
|
+
- - "~>"
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: '1.21'
|
235
|
+
- !ruby/object:Gem::Dependency
|
236
|
+
name: rubocop-rails
|
237
|
+
requirement: !ruby/object:Gem::Requirement
|
238
|
+
requirements:
|
239
|
+
- - "~>"
|
240
|
+
- !ruby/object:Gem::Version
|
241
|
+
version: '2.24'
|
242
|
+
type: :development
|
243
|
+
prerelease: false
|
244
|
+
version_requirements: !ruby/object:Gem::Requirement
|
245
|
+
requirements:
|
246
|
+
- - "~>"
|
247
|
+
- !ruby/object:Gem::Version
|
248
|
+
version: '2.24'
|
249
|
+
- !ruby/object:Gem::Dependency
|
250
|
+
name: rubocop-rspec
|
251
|
+
requirement: !ruby/object:Gem::Requirement
|
252
|
+
requirements:
|
253
|
+
- - "~>"
|
254
|
+
- !ruby/object:Gem::Version
|
255
|
+
version: '2.29'
|
256
|
+
type: :development
|
257
|
+
prerelease: false
|
258
|
+
version_requirements: !ruby/object:Gem::Requirement
|
259
|
+
requirements:
|
260
|
+
- - "~>"
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: '2.29'
|
179
263
|
- !ruby/object:Gem::Dependency
|
180
264
|
name: mysql2
|
181
265
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,28 +280,42 @@ dependencies:
|
|
196
280
|
requirements:
|
197
281
|
- - "~>"
|
198
282
|
- !ruby/object:Gem::Version
|
199
|
-
version: '1.
|
283
|
+
version: '1.5'
|
200
284
|
type: :development
|
201
285
|
prerelease: false
|
202
286
|
version_requirements: !ruby/object:Gem::Requirement
|
203
287
|
requirements:
|
204
288
|
- - "~>"
|
205
289
|
- !ruby/object:Gem::Version
|
206
|
-
version: '1.
|
290
|
+
version: '1.5'
|
207
291
|
- !ruby/object:Gem::Dependency
|
208
292
|
name: sqlite3
|
209
293
|
requirement: !ruby/object:Gem::Requirement
|
210
294
|
requirements:
|
211
|
-
- - "
|
295
|
+
- - "<"
|
212
296
|
- !ruby/object:Gem::Version
|
213
|
-
version:
|
297
|
+
version: '2.0'
|
214
298
|
type: :development
|
215
299
|
prerelease: false
|
216
300
|
version_requirements: !ruby/object:Gem::Requirement
|
217
301
|
requirements:
|
218
|
-
- - "
|
302
|
+
- - "<"
|
219
303
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
304
|
+
version: '2.0'
|
305
|
+
- !ruby/object:Gem::Dependency
|
306
|
+
name: trilogy
|
307
|
+
requirement: !ruby/object:Gem::Requirement
|
308
|
+
requirements:
|
309
|
+
- - "<"
|
310
|
+
- !ruby/object:Gem::Version
|
311
|
+
version: '3.0'
|
312
|
+
type: :development
|
313
|
+
prerelease: false
|
314
|
+
version_requirements: !ruby/object:Gem::Requirement
|
315
|
+
requirements:
|
316
|
+
- - "<"
|
317
|
+
- !ruby/object:Gem::Version
|
318
|
+
version: '3.0'
|
221
319
|
description: Apartment allows Rack applications to deal with database multitenancy
|
222
320
|
through ActiveRecord
|
223
321
|
email:
|
@@ -228,33 +326,22 @@ executables: []
|
|
228
326
|
extensions: []
|
229
327
|
extra_rdoc_files: []
|
230
328
|
files:
|
231
|
-
- ".circleci/config.yml"
|
232
|
-
- ".github/ISSUE_TEMPLATE.md"
|
233
|
-
- ".github/workflows/changelog.yml"
|
234
329
|
- ".gitignore"
|
235
330
|
- ".pryrc"
|
236
331
|
- ".rspec"
|
237
332
|
- ".rubocop.yml"
|
238
333
|
- ".rubocop_todo.yml"
|
239
|
-
- ".
|
334
|
+
- ".ruby-version"
|
240
335
|
- Appraisals
|
241
336
|
- CHANGELOG.md
|
242
337
|
- Gemfile
|
243
338
|
- Guardfile
|
244
|
-
- HISTORY.md
|
245
339
|
- README.md
|
246
340
|
- Rakefile
|
247
|
-
- TODO.md
|
248
|
-
- docker-compose.yml
|
249
|
-
- gemfiles/rails_4_2.gemfile
|
250
|
-
- gemfiles/rails_5_0.gemfile
|
251
|
-
- gemfiles/rails_5_1.gemfile
|
252
|
-
- gemfiles/rails_5_2.gemfile
|
253
|
-
- gemfiles/rails_6_0.gemfile
|
254
|
-
- gemfiles/rails_master.gemfile
|
255
341
|
- lib/apartment.rb
|
256
342
|
- lib/apartment/active_record/connection_handling.rb
|
257
343
|
- lib/apartment/active_record/internal_metadata.rb
|
344
|
+
- lib/apartment/active_record/postgresql_adapter.rb
|
258
345
|
- lib/apartment/active_record/schema_migration.rb
|
259
346
|
- lib/apartment/adapters/abstract_adapter.rb
|
260
347
|
- lib/apartment/adapters/abstract_jdbc_adapter.rb
|
@@ -264,6 +351,7 @@ files:
|
|
264
351
|
- lib/apartment/adapters/postgis_adapter.rb
|
265
352
|
- lib/apartment/adapters/postgresql_adapter.rb
|
266
353
|
- lib/apartment/adapters/sqlite3_adapter.rb
|
354
|
+
- lib/apartment/adapters/trilogy_adapter.rb
|
267
355
|
- lib/apartment/console.rb
|
268
356
|
- lib/apartment/custom_console.rb
|
269
357
|
- lib/apartment/deprecation.rb
|
@@ -277,7 +365,6 @@ files:
|
|
277
365
|
- lib/apartment/migrator.rb
|
278
366
|
- lib/apartment/model.rb
|
279
367
|
- lib/apartment/railtie.rb
|
280
|
-
- lib/apartment/reloader.rb
|
281
368
|
- lib/apartment/tasks/enhancements.rb
|
282
369
|
- lib/apartment/tasks/task_helper.rb
|
283
370
|
- lib/apartment/tenant.rb
|
@@ -290,8 +377,9 @@ files:
|
|
290
377
|
homepage: https://github.com/rails-on-services/apartment
|
291
378
|
licenses:
|
292
379
|
- MIT
|
293
|
-
metadata:
|
294
|
-
|
380
|
+
metadata:
|
381
|
+
github_repo: ssh://github.com/rails-on-services/apartment
|
382
|
+
post_install_message:
|
295
383
|
rdoc_options: []
|
296
384
|
require_paths:
|
297
385
|
- lib
|
@@ -299,15 +387,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
387
|
requirements:
|
300
388
|
- - ">="
|
301
389
|
- !ruby/object:Gem::Version
|
302
|
-
version: '0'
|
390
|
+
version: '3.0'
|
391
|
+
- - "<"
|
392
|
+
- !ruby/object:Gem::Version
|
393
|
+
version: '3.4'
|
303
394
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
304
395
|
requirements:
|
305
396
|
- - ">="
|
306
397
|
- !ruby/object:Gem::Version
|
307
398
|
version: '0'
|
308
399
|
requirements: []
|
309
|
-
rubygems_version: 3.
|
310
|
-
signing_key:
|
400
|
+
rubygems_version: 3.5.10
|
401
|
+
signing_key:
|
311
402
|
specification_version: 4
|
312
403
|
summary: A Ruby gem for managing database multitenancy. Apartment Gem drop in replacement
|
313
404
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
|
3
|
-
orbs:
|
4
|
-
rubocop: hanachin/rubocop@0.0.6
|
5
|
-
|
6
|
-
jobs:
|
7
|
-
build:
|
8
|
-
docker:
|
9
|
-
- image: circleci/<< parameters.ruby_version >>
|
10
|
-
- image: circleci/postgres:9.6.2-alpine
|
11
|
-
- image: circleci/mysql:5.7
|
12
|
-
environment:
|
13
|
-
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
14
|
-
parameters:
|
15
|
-
ruby_version:
|
16
|
-
type: string
|
17
|
-
gemfile:
|
18
|
-
type: string
|
19
|
-
environment:
|
20
|
-
BUNDLE_GEMFILE: << parameters.gemfile >>
|
21
|
-
steps:
|
22
|
-
- checkout
|
23
|
-
# Restore Cached Dependencies
|
24
|
-
# - restore_cache:
|
25
|
-
# keys:
|
26
|
-
# - gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
|
27
|
-
# - gem-cache-v1-{{ arch }}-{{ .Branch }}
|
28
|
-
# - gem-cache-v1
|
29
|
-
|
30
|
-
- run: bundle install --path vendor/bundle
|
31
|
-
|
32
|
-
# - save_cache:
|
33
|
-
# key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
|
34
|
-
# paths:
|
35
|
-
# - vendor/bundle
|
36
|
-
|
37
|
-
- run:
|
38
|
-
name: Install postgres client
|
39
|
-
command: sudo apt install -y postgresql-client
|
40
|
-
|
41
|
-
- run:
|
42
|
-
name: Install mysql client
|
43
|
-
command: sudo apt install -y default-mysql-client
|
44
|
-
|
45
|
-
- run:
|
46
|
-
name: Configure config database.yml
|
47
|
-
command: bundle exec rake db:copy_credentials
|
48
|
-
|
49
|
-
- run:
|
50
|
-
name: wait for postgresql
|
51
|
-
command: dockerize -wait tcp://localhost:5432 -timeout 1m
|
52
|
-
|
53
|
-
- run:
|
54
|
-
name: wait for mysql
|
55
|
-
command: dockerize -wait tcp://localhost:3306 -timeout 1m
|
56
|
-
|
57
|
-
- run:
|
58
|
-
name: Database Setup
|
59
|
-
command: |
|
60
|
-
bundle exec rake db:test:prepare
|
61
|
-
|
62
|
-
- run:
|
63
|
-
name: Run tests
|
64
|
-
command: bundle exec rspec
|
65
|
-
|
66
|
-
workflows:
|
67
|
-
tests:
|
68
|
-
jobs:
|
69
|
-
- build:
|
70
|
-
matrix:
|
71
|
-
parameters:
|
72
|
-
ruby_version: ["ruby:2.6-buster", "ruby:2.7-buster"]
|
73
|
-
gemfile: ["gemfiles/rails_5_2.gemfile", "gemfiles/rails_6_0.gemfile"]
|
74
|
-
|
75
|
-
rubocop:
|
76
|
-
jobs:
|
77
|
-
- rubocop/rubocop:
|
78
|
-
version: 0.88.0
|
data/.github/ISSUE_TEMPLATE.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
## Steps to reproduce
|
2
|
-
|
3
|
-
## Expected behavior
|
4
|
-
|
5
|
-
## Actual behavior
|
6
|
-
|
7
|
-
## System configuration
|
8
|
-
|
9
|
-
<!-- Please let us know as far as you can. -->
|
10
|
-
|
11
|
-
* Database: (Tell us what database and its version you use.)
|
12
|
-
|
13
|
-
* Apartment version:
|
14
|
-
|
15
|
-
* Apartment config (in `config/initializers/apartment.rb` or so):
|
16
|
-
|
17
|
-
* `use_schemas`: (`true` or `false`)
|
18
|
-
|
19
|
-
* Rails (or ActiveRecord) version:
|
20
|
-
|
21
|
-
* Ruby version:
|
@@ -1,63 +0,0 @@
|
|
1
|
-
name: Changelog
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
types: [closed]
|
6
|
-
|
7
|
-
release:
|
8
|
-
types: [published]
|
9
|
-
|
10
|
-
issues:
|
11
|
-
types: [closed, edited]
|
12
|
-
|
13
|
-
jobs:
|
14
|
-
generate_changelog:
|
15
|
-
runs-on: ubuntu-latest
|
16
|
-
name: Generate changelog for master branch
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v2
|
19
|
-
with:
|
20
|
-
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
|
21
|
-
|
22
|
-
- name: Generate changelog
|
23
|
-
uses: charmixer/auto-changelog-action@v1
|
24
|
-
with:
|
25
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
26
|
-
|
27
|
-
- name: Commit files
|
28
|
-
env:
|
29
|
-
ACTION_EMAIL: action@github.com
|
30
|
-
ACTION_USERNAME: GitHub Action
|
31
|
-
run: |
|
32
|
-
git config --local user.email "$ACTION_EMAIL"
|
33
|
-
git config --local user.name "$ACTION_USERNAME"
|
34
|
-
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
|
35
|
-
|
36
|
-
- name: Push changes
|
37
|
-
if: env.push == 1
|
38
|
-
env:
|
39
|
-
# CI_USER: ${{ secrets.YOUR_GITHUB_USER }}
|
40
|
-
CI_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
|
41
|
-
run: |
|
42
|
-
git push "https://$GITHUB_ACTOR:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master
|
43
|
-
|
44
|
-
# - name: Push changelog to master
|
45
|
-
# if: env.push == 1
|
46
|
-
# uses: ad-m/github-push-action@master
|
47
|
-
# with:
|
48
|
-
# github_token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
|
49
|
-
# branch: master
|
50
|
-
|
51
|
-
# - name: Cherry-pick changelog to development
|
52
|
-
# if: env.push == 1
|
53
|
-
# env:
|
54
|
-
# ACTION_EMAIL: action@github.com
|
55
|
-
# ACTION_USERNAME: GitHub Action
|
56
|
-
# run: |
|
57
|
-
# git config --local user.email "$ACTION_EMAIL"
|
58
|
-
# git config --local user.name "$ACTION_USERNAME"
|
59
|
-
# commit_hash=`git show HEAD | egrep commit\ .+$ | cut -d' ' -f2`
|
60
|
-
# git checkout development
|
61
|
-
# git pull
|
62
|
-
# git cherry-pick $commit_hash
|
63
|
-
# git push
|