activerecord-multi-tenant 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/active-record-multi-tenant-tests.yml +80 -0
  3. data/.gitignore +6 -0
  4. data/.readthedocs.yaml +15 -0
  5. data/.rspec +0 -0
  6. data/.rubocop.yml +51 -0
  7. data/Appraisals +0 -0
  8. data/CHANGELOG.md +6 -0
  9. data/Gemfile +3 -1
  10. data/LICENSE +0 -0
  11. data/README.md +2 -1
  12. data/Rakefile +1 -1
  13. data/activerecord-multi-tenant.gemspec +28 -22
  14. data/docker-compose.yml +24 -18
  15. data/docs/.gitignore +3 -0
  16. data/docs/Makefile +28 -0
  17. data/docs/api-reference.sh +10 -0
  18. data/docs/requirements.in +4 -0
  19. data/docs/requirements.txt +62 -0
  20. data/docs/source/_static/api-reference/ActiveRecord/Associations/Association.html +285 -0
  21. data/docs/source/_static/api-reference/ActiveRecord/Associations/ClassMethods.html +255 -0
  22. data/docs/source/_static/api-reference/ActiveRecord/Associations.html +117 -0
  23. data/docs/source/_static/api-reference/ActiveRecord/ConnectionAdapters/SchemaStatements.html +232 -0
  24. data/docs/source/_static/api-reference/ActiveRecord/ConnectionAdapters.html +126 -0
  25. data/docs/source/_static/api-reference/ActiveRecord/QueryMethods.html +336 -0
  26. data/docs/source/_static/api-reference/ActiveRecord/SchemaDumper.html +121 -0
  27. data/docs/source/_static/api-reference/ActiveRecord.html +130 -0
  28. data/docs/source/_static/api-reference/MultiTenant/ArelTenantVisitor.html +755 -0
  29. data/docs/source/_static/api-reference/MultiTenant/ArelVisitorsDepthFirst.html +208 -0
  30. data/docs/source/_static/api-reference/MultiTenant/BaseTenantEnforcementClause.html +462 -0
  31. data/docs/source/_static/api-reference/MultiTenant/Context.html +659 -0
  32. data/docs/source/_static/api-reference/MultiTenant/ControllerExtensions.html +202 -0
  33. data/docs/source/_static/api-reference/MultiTenant/CopyFromClient.html +186 -0
  34. data/docs/source/_static/api-reference/MultiTenant/CopyFromClientHelper.html +362 -0
  35. data/docs/source/_static/api-reference/MultiTenant/Current.html +124 -0
  36. data/docs/source/_static/api-reference/MultiTenant/DatabaseStatements.html +366 -0
  37. data/docs/source/_static/api-reference/MultiTenant/FastTruncate.html +226 -0
  38. data/docs/source/_static/api-reference/MultiTenant/MigrationExtensions.html +554 -0
  39. data/docs/source/_static/api-reference/MultiTenant/MissingTenantError.html +124 -0
  40. data/docs/source/_static/api-reference/MultiTenant/ModelExtensionsClassMethods.html +492 -0
  41. data/docs/source/_static/api-reference/MultiTenant/QueryMonitor.html +257 -0
  42. data/docs/source/_static/api-reference/MultiTenant/Table.html +419 -0
  43. data/docs/source/_static/api-reference/MultiTenant/TenantEnforcementClause.html +148 -0
  44. data/docs/source/_static/api-reference/MultiTenant/TenantIsImmutable.html +135 -0
  45. data/docs/source/_static/api-reference/MultiTenant/TenantJoinEnforcementClause.html +310 -0
  46. data/docs/source/_static/api-reference/MultiTenant/TenantValueVisitor.html +239 -0
  47. data/docs/source/_static/api-reference/MultiTenant.html +1454 -0
  48. data/docs/source/_static/api-reference/MultiTenantFindBy.html +180 -0
  49. data/docs/source/_static/api-reference/Sidekiq/Client.html +302 -0
  50. data/docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant/Client.html +217 -0
  51. data/docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant/Server.html +219 -0
  52. data/docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant.html +126 -0
  53. data/docs/source/_static/api-reference/Sidekiq.html +126 -0
  54. data/docs/source/_static/api-reference/_index.html +399 -0
  55. data/docs/source/_static/api-reference/class_list.html +51 -0
  56. data/docs/source/_static/api-reference/css/common.css +1 -0
  57. data/docs/source/_static/api-reference/css/full_list.css +58 -0
  58. data/docs/source/_static/api-reference/css/style.css +497 -0
  59. data/docs/source/_static/api-reference/file.README.html +167 -0
  60. data/docs/source/_static/api-reference/file_list.html +56 -0
  61. data/docs/source/_static/api-reference/frames.html +17 -0
  62. data/docs/source/_static/api-reference/index.html +167 -0
  63. data/docs/source/_static/api-reference/js/app.js +314 -0
  64. data/docs/source/_static/api-reference/js/full_list.js +216 -0
  65. data/docs/source/_static/api-reference/js/jquery.js +4 -0
  66. data/docs/source/_static/api-reference/method_list.html +715 -0
  67. data/docs/source/_static/api-reference/top-level-namespace.html +126 -0
  68. data/docs/source/_templates/.gitignore +4 -0
  69. data/docs/source/api-reference.rst +8 -0
  70. data/docs/source/appendix.rst +26 -0
  71. data/docs/source/changelog.rst +8 -0
  72. data/docs/source/community-and-support.rst +26 -0
  73. data/docs/source/conf.py +30 -0
  74. data/docs/source/contributing.rst +70 -0
  75. data/docs/source/getting-started.rst +37 -0
  76. data/docs/source/guides-and-tutorials.rst +129 -0
  77. data/docs/source/index.rst +54 -0
  78. data/docs/source/introduction.rst +33 -0
  79. data/docs/source/license.rst +22 -0
  80. data/docs/source/troubleshooting.rst +41 -0
  81. data/docs/source/usage-guide.rst +59 -0
  82. data/lib/activerecord-multi-tenant/arel_visitors_depth_first.rb +183 -174
  83. data/lib/activerecord-multi-tenant/controller_extensions.rb +15 -4
  84. data/lib/activerecord-multi-tenant/copy_from_client.rb +4 -0
  85. data/lib/activerecord-multi-tenant/fast_truncate.rb +4 -2
  86. data/lib/activerecord-multi-tenant/habtm.rb +50 -0
  87. data/lib/activerecord-multi-tenant/migrations.rb +18 -8
  88. data/lib/activerecord-multi-tenant/model_extensions.rb +78 -37
  89. data/lib/activerecord-multi-tenant/multi_tenant.rb +40 -21
  90. data/lib/activerecord-multi-tenant/query_monitor.rb +21 -5
  91. data/lib/activerecord-multi-tenant/query_rewriter.rb +111 -80
  92. data/lib/activerecord-multi-tenant/sidekiq.rb +31 -20
  93. data/lib/activerecord-multi-tenant/version.rb +1 -1
  94. data/lib/activerecord-multi-tenant.rb +3 -12
  95. data/lib/activerecord_multi_tenant.rb +12 -0
  96. data/spec/activerecord-multi-tenant/associations_spec.rb +21 -0
  97. data/spec/activerecord-multi-tenant/controller_extensions_spec.rb +3 -2
  98. data/spec/activerecord-multi-tenant/fast_truncate_spec.rb +8 -6
  99. data/spec/activerecord-multi-tenant/model_extensions_spec.rb +233 -153
  100. data/spec/activerecord-multi-tenant/multi_tenant_spec.rb +15 -13
  101. data/spec/activerecord-multi-tenant/query_rewriter_spec.rb +60 -59
  102. data/spec/activerecord-multi-tenant/record_callback_spec.rb +0 -0
  103. data/spec/activerecord-multi-tenant/record_finding_spec.rb +11 -11
  104. data/spec/activerecord-multi-tenant/record_modifications_spec.rb +4 -4
  105. data/spec/activerecord-multi-tenant/sidekiq_spec.rb +10 -10
  106. data/spec/database.yml +0 -0
  107. data/spec/schema.rb +20 -2
  108. data/spec/spec_helper.rb +46 -17
  109. data/spec/support/format_sql.rb +20 -0
  110. metadata +130 -25
  111. data/.github/workflows/CI.yml +0 -47
  112. data/gemfiles/.bundle/config +0 -2
  113. data/gemfiles/active_record_6.0.gemfile +0 -8
  114. data/gemfiles/active_record_6.1.gemfile +0 -8
  115. data/gemfiles/active_record_7.0.gemfile +0 -8
  116. data/gemfiles/rails_6.0.gemfile +0 -8
  117. data/gemfiles/rails_6.1.gemfile +0 -8
  118. data/gemfiles/rails_7.0.gemfile +0 -8
  119. data/lib/activerecord-multi-tenant/with_lock.rb +0 -15
  120. data/spec/activerecord-multi-tenant/schema_dumper_tester.rb +0 -0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-multi-tenant
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Citus Data
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -25,21 +25,21 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: anbt-sql-formatter
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec-rails
42
+ name: codecov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rake
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +109,21 @@ dependencies:
81
109
  - !ruby/object:Gem::Version
82
110
  version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
- name: sidekiq
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '3.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec-rails
85
127
  requirement: !ruby/object:Gem::Requirement
86
128
  requirements:
87
129
  - - ">="
@@ -95,7 +137,7 @@ dependencies:
95
137
  - !ruby/object:Gem::Version
96
138
  version: '0'
97
139
  - !ruby/object:Gem::Dependency
98
- name: thor
140
+ name: rubocop
99
141
  requirement: !ruby/object:Gem::Requirement
100
142
  requirements:
101
143
  - - ">="
@@ -109,7 +151,7 @@ dependencies:
109
151
  - !ruby/object:Gem::Version
110
152
  version: '0'
111
153
  - !ruby/object:Gem::Dependency
112
- name: pry
154
+ name: sidekiq
113
155
  requirement: !ruby/object:Gem::Requirement
114
156
  requirements:
115
157
  - - ">="
@@ -123,7 +165,7 @@ dependencies:
123
165
  - !ruby/object:Gem::Version
124
166
  version: '0'
125
167
  - !ruby/object:Gem::Dependency
126
- name: pry-byebug
168
+ name: thor
127
169
  requirement: !ruby/object:Gem::Requirement
128
170
  requirements:
129
171
  - - ">="
@@ -142,9 +184,11 @@ executables: []
142
184
  extensions: []
143
185
  extra_rdoc_files: []
144
186
  files:
145
- - ".github/workflows/CI.yml"
187
+ - ".github/workflows/active-record-multi-tenant-tests.yml"
146
188
  - ".gitignore"
189
+ - ".readthedocs.yaml"
147
190
  - ".rspec"
191
+ - ".rubocop.yml"
148
192
  - Appraisals
149
193
  - CHANGELOG.md
150
194
  - Gemfile
@@ -153,18 +197,79 @@ files:
153
197
  - Rakefile
154
198
  - activerecord-multi-tenant.gemspec
155
199
  - docker-compose.yml
156
- - gemfiles/.bundle/config
157
- - gemfiles/active_record_6.0.gemfile
158
- - gemfiles/active_record_6.1.gemfile
159
- - gemfiles/active_record_7.0.gemfile
160
- - gemfiles/rails_6.0.gemfile
161
- - gemfiles/rails_6.1.gemfile
162
- - gemfiles/rails_7.0.gemfile
200
+ - docs/.gitignore
201
+ - docs/Makefile
202
+ - docs/api-reference.sh
203
+ - docs/requirements.in
204
+ - docs/requirements.txt
205
+ - docs/source/_static/api-reference/ActiveRecord.html
206
+ - docs/source/_static/api-reference/ActiveRecord/Associations.html
207
+ - docs/source/_static/api-reference/ActiveRecord/Associations/Association.html
208
+ - docs/source/_static/api-reference/ActiveRecord/Associations/ClassMethods.html
209
+ - docs/source/_static/api-reference/ActiveRecord/ConnectionAdapters.html
210
+ - docs/source/_static/api-reference/ActiveRecord/ConnectionAdapters/SchemaStatements.html
211
+ - docs/source/_static/api-reference/ActiveRecord/QueryMethods.html
212
+ - docs/source/_static/api-reference/ActiveRecord/SchemaDumper.html
213
+ - docs/source/_static/api-reference/MultiTenant.html
214
+ - docs/source/_static/api-reference/MultiTenant/ArelTenantVisitor.html
215
+ - docs/source/_static/api-reference/MultiTenant/ArelVisitorsDepthFirst.html
216
+ - docs/source/_static/api-reference/MultiTenant/BaseTenantEnforcementClause.html
217
+ - docs/source/_static/api-reference/MultiTenant/Context.html
218
+ - docs/source/_static/api-reference/MultiTenant/ControllerExtensions.html
219
+ - docs/source/_static/api-reference/MultiTenant/CopyFromClient.html
220
+ - docs/source/_static/api-reference/MultiTenant/CopyFromClientHelper.html
221
+ - docs/source/_static/api-reference/MultiTenant/Current.html
222
+ - docs/source/_static/api-reference/MultiTenant/DatabaseStatements.html
223
+ - docs/source/_static/api-reference/MultiTenant/FastTruncate.html
224
+ - docs/source/_static/api-reference/MultiTenant/MigrationExtensions.html
225
+ - docs/source/_static/api-reference/MultiTenant/MissingTenantError.html
226
+ - docs/source/_static/api-reference/MultiTenant/ModelExtensionsClassMethods.html
227
+ - docs/source/_static/api-reference/MultiTenant/QueryMonitor.html
228
+ - docs/source/_static/api-reference/MultiTenant/Table.html
229
+ - docs/source/_static/api-reference/MultiTenant/TenantEnforcementClause.html
230
+ - docs/source/_static/api-reference/MultiTenant/TenantIsImmutable.html
231
+ - docs/source/_static/api-reference/MultiTenant/TenantJoinEnforcementClause.html
232
+ - docs/source/_static/api-reference/MultiTenant/TenantValueVisitor.html
233
+ - docs/source/_static/api-reference/MultiTenantFindBy.html
234
+ - docs/source/_static/api-reference/Sidekiq.html
235
+ - docs/source/_static/api-reference/Sidekiq/Client.html
236
+ - docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant.html
237
+ - docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant/Client.html
238
+ - docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant/Server.html
239
+ - docs/source/_static/api-reference/_index.html
240
+ - docs/source/_static/api-reference/class_list.html
241
+ - docs/source/_static/api-reference/css/common.css
242
+ - docs/source/_static/api-reference/css/full_list.css
243
+ - docs/source/_static/api-reference/css/style.css
244
+ - docs/source/_static/api-reference/file.README.html
245
+ - docs/source/_static/api-reference/file_list.html
246
+ - docs/source/_static/api-reference/frames.html
247
+ - docs/source/_static/api-reference/index.html
248
+ - docs/source/_static/api-reference/js/app.js
249
+ - docs/source/_static/api-reference/js/full_list.js
250
+ - docs/source/_static/api-reference/js/jquery.js
251
+ - docs/source/_static/api-reference/method_list.html
252
+ - docs/source/_static/api-reference/top-level-namespace.html
253
+ - docs/source/_templates/.gitignore
254
+ - docs/source/api-reference.rst
255
+ - docs/source/appendix.rst
256
+ - docs/source/changelog.rst
257
+ - docs/source/community-and-support.rst
258
+ - docs/source/conf.py
259
+ - docs/source/contributing.rst
260
+ - docs/source/getting-started.rst
261
+ - docs/source/guides-and-tutorials.rst
262
+ - docs/source/index.rst
263
+ - docs/source/introduction.rst
264
+ - docs/source/license.rst
265
+ - docs/source/troubleshooting.rst
266
+ - docs/source/usage-guide.rst
163
267
  - lib/activerecord-multi-tenant.rb
164
268
  - lib/activerecord-multi-tenant/arel_visitors_depth_first.rb
165
269
  - lib/activerecord-multi-tenant/controller_extensions.rb
166
270
  - lib/activerecord-multi-tenant/copy_from_client.rb
167
271
  - lib/activerecord-multi-tenant/fast_truncate.rb
272
+ - lib/activerecord-multi-tenant/habtm.rb
168
273
  - lib/activerecord-multi-tenant/migrations.rb
169
274
  - lib/activerecord-multi-tenant/model_extensions.rb
170
275
  - lib/activerecord-multi-tenant/multi_tenant.rb
@@ -172,7 +277,7 @@ files:
172
277
  - lib/activerecord-multi-tenant/query_rewriter.rb
173
278
  - lib/activerecord-multi-tenant/sidekiq.rb
174
279
  - lib/activerecord-multi-tenant/version.rb
175
- - lib/activerecord-multi-tenant/with_lock.rb
280
+ - lib/activerecord_multi_tenant.rb
176
281
  - spec/activerecord-multi-tenant/associations_spec.rb
177
282
  - spec/activerecord-multi-tenant/controller_extensions_spec.rb
178
283
  - spec/activerecord-multi-tenant/fast_truncate_spec.rb
@@ -182,16 +287,16 @@ files:
182
287
  - spec/activerecord-multi-tenant/record_callback_spec.rb
183
288
  - spec/activerecord-multi-tenant/record_finding_spec.rb
184
289
  - spec/activerecord-multi-tenant/record_modifications_spec.rb
185
- - spec/activerecord-multi-tenant/schema_dumper_tester.rb
186
290
  - spec/activerecord-multi-tenant/sidekiq_spec.rb
187
291
  - spec/database.yml
188
292
  - spec/schema.rb
189
293
  - spec/spec_helper.rb
294
+ - spec/support/format_sql.rb
190
295
  homepage: https://github.com/citusdata/activerecord-multi-tenant
191
296
  licenses:
192
297
  - MIT
193
298
  metadata: {}
194
- post_install_message:
299
+ post_install_message:
195
300
  rdoc_options: []
196
301
  require_paths:
197
302
  - lib
@@ -199,15 +304,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
304
  requirements:
200
305
  - - ">="
201
306
  - !ruby/object:Gem::Version
202
- version: '0'
307
+ version: 3.0.0
203
308
  required_rubygems_version: !ruby/object:Gem::Requirement
204
309
  requirements:
205
310
  - - ">="
206
311
  - !ruby/object:Gem::Version
207
312
  version: '0'
208
313
  requirements: []
209
- rubygems_version: 3.2.32
210
- signing_key:
314
+ rubygems_version: 3.4.13
315
+ signing_key:
211
316
  specification_version: 4
212
317
  summary: ActiveRecord/Rails integration for multi-tenant databases, in particular
213
318
  the Citus extension for PostgreSQL
@@ -1,47 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
-
9
- jobs:
10
- build:
11
- runs-on: ubuntu-latest
12
- strategy:
13
- fail-fast: false
14
- matrix:
15
- ruby:
16
- - '2.6'
17
- - '2.7'
18
- - '3.0'
19
- - '3.1'
20
- gemfile:
21
- - rails_6.0
22
- - rails_6.1
23
- - rails_7.0
24
- - active_record_6.0
25
- - active_record_6.1
26
- - active_record_7.0
27
- prepared_statements: [true, false]
28
- exclude:
29
- # activesupport-7.0.0 requires ruby version >= 2.7.0
30
- - ruby: '2.6'
31
- gemfile: 'rails_7.0'
32
- - ruby: '2.6'
33
- gemfile: 'active_record_7.0'
34
- name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} ${{ (matrix.prepared_statements && 'w/ prepared statements') || '' }}
35
- env:
36
- BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
37
- PREPARED_STATEMENTS: ${{ matrix.prepared_statements && '1' }}
38
- steps:
39
- - uses: actions/checkout@v2
40
- - run: |
41
- docker-compose up -d
42
- - uses: ruby/setup-ruby@v1
43
- with:
44
- ruby-version: ${{ matrix.ruby }}
45
- bundler-cache: true
46
- - run: |
47
- bundle exec rake spec
@@ -1,2 +0,0 @@
1
- ---
2
- BUNDLE_RETRY: "1"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activerecord", "~> 6.0.3"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activerecord", "~> 6.1.0"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activerecord", "~> 7.0.0"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rails", "~> 6.0.3"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rails", "~> 6.1.0"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rails", "~> 7.0.0"
7
-
8
- gemspec path: "../"
@@ -1,15 +0,0 @@
1
- # Workaround for https://github.com/citusdata/citus/issues/1236
2
- # "SELECT ... FOR UPDATE is not supported for router-plannable queries"
3
-
4
- class ActiveRecord::Base
5
- alias :lock_orig :lock!
6
- def lock!(lock = true)
7
- if lock && persisted? && self.class.respond_to?(:scoped_by_tenant?) && MultiTenant.current_tenant_id && MultiTenant.with_lock_workaround_enabled?
8
- self.class.unscoped.where(id: id).update_all(id: id) # No-op UPDATE that locks the row
9
- reload # This is just to act similar to the default ActiveRecord approach, in case someone relies on the reload
10
- self
11
- else
12
- lock_orig(lock)
13
- end
14
- end
15
- end