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
@@ -0,0 +1,755 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: MultiTenant::ArelTenantVisitor
8
+
9
+ &mdash; Documentation by YARD 0.9.34
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "MultiTenant::ArelTenantVisitor";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../MultiTenant.html" title="MultiTenant (module)">MultiTenant</a></span></span>
41
+ &raquo;
42
+ <span class="title">ArelTenantVisitor</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: MultiTenant::ArelTenantVisitor
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">MultiTenant::ArelTenantVisitor</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/activerecord-multi-tenant/query_rewriter.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#contexts-instance_method" title="#contexts (instance method)">#<strong>contexts</strong> &#x21d2; Object </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'>
132
+ <p>Returns the value of attribute contexts.</p>
133
+ </div></span>
134
+
135
+ </li>
136
+
137
+
138
+ </ul>
139
+
140
+
141
+
142
+
143
+
144
+ <h2>
145
+ Instance Method Summary
146
+ <small><a href="#" class="summary_toggle">collapse</a></small>
147
+ </h2>
148
+
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(arel) &#x21d2; ArelTenantVisitor </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+ <span class="note title constructor">constructor</span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ <span class="summary_desc"><div class='inline'>
171
+ <p>A new instance of ArelTenantVisitor.</p>
172
+ </div></span>
173
+
174
+ </li>
175
+
176
+
177
+ <li class="public ">
178
+ <span class="summary_signature">
179
+
180
+ <a href="#visit_Arel_Attributes_Attribute-instance_method" title="#visit_Arel_Attributes_Attribute (instance method)">#<strong>visit_Arel_Attributes_Attribute</strong>(*args) &#x21d2; Object </a>
181
+
182
+
183
+
184
+ </span>
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+ <span class="summary_desc"><div class='inline'>
195
+ <p>rubocop:disable Naming/MethodName.</p>
196
+ </div></span>
197
+
198
+ </li>
199
+
200
+
201
+ <li class="public ">
202
+ <span class="summary_signature">
203
+
204
+ <a href="#visit_Arel_Nodes_Equality-instance_method" title="#visit_Arel_Nodes_Equality (instance method)">#<strong>visit_Arel_Nodes_Equality</strong>(obj, *args) &#x21d2; Object </a>
205
+
206
+
207
+
208
+ </span>
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+ <span class="summary_desc"><div class='inline'></div></span>
219
+
220
+ </li>
221
+
222
+
223
+ <li class="public ">
224
+ <span class="summary_signature">
225
+
226
+ <a href="#visit_Arel_Nodes_OuterJoin-instance_method" title="#visit_Arel_Nodes_OuterJoin (instance method)">#<strong>visit_Arel_Nodes_OuterJoin</strong>(obj, _collector = nil) &#x21d2; Object </a>
227
+
228
+
229
+
230
+ (also: #visit_Arel_Nodes_FullOuterJoin, #visit_Arel_Nodes_RightOuterJoin)
231
+
232
+ </span>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ <span class="summary_desc"><div class='inline'>
243
+ <p>rubocop:disable Naming/MethodName.</p>
244
+ </div></span>
245
+
246
+ </li>
247
+
248
+
249
+ <li class="public ">
250
+ <span class="summary_signature">
251
+
252
+ <a href="#visit_Arel_Nodes_SelectCore-instance_method" title="#visit_Arel_Nodes_SelectCore (instance method)">#<strong>visit_Arel_Nodes_SelectCore</strong>(obj, *_args) &#x21d2; Object </a>
253
+
254
+
255
+
256
+ </span>
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ <span class="summary_desc"><div class='inline'></div></span>
267
+
268
+ </li>
269
+
270
+
271
+ <li class="public ">
272
+ <span class="summary_signature">
273
+
274
+ <a href="#visit_Arel_Table-instance_method" title="#visit_Arel_Table (instance method)">#<strong>visit_Arel_Table</strong>(obj, _collector = nil) &#x21d2; Object </a>
275
+
276
+
277
+
278
+ (also: #visit_Arel_Nodes_TableAlias)
279
+
280
+ </span>
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+ <span class="summary_desc"><div class='inline'></div></span>
291
+
292
+ </li>
293
+
294
+
295
+ <li class="public ">
296
+ <span class="summary_signature">
297
+
298
+ <a href="#visit_MultiTenant_TenantEnforcementClause-instance_method" title="#visit_MultiTenant_TenantEnforcementClause (instance method)">#<strong>visit_MultiTenant_TenantEnforcementClause</strong>(obj) &#x21d2; Object </a>
299
+
300
+
301
+
302
+ </span>
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+ <span class="summary_desc"><div class='inline'></div></span>
313
+
314
+ </li>
315
+
316
+
317
+ <li class="public ">
318
+ <span class="summary_signature">
319
+
320
+ <a href="#visit_MultiTenant_TenantJoinEnforcementClause-instance_method" title="#visit_MultiTenant_TenantJoinEnforcementClause (instance method)">#<strong>visit_MultiTenant_TenantJoinEnforcementClause</strong>(obj) &#x21d2; Object </a>
321
+
322
+
323
+
324
+ </span>
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+ <span class="summary_desc"><div class='inline'></div></span>
335
+
336
+ </li>
337
+
338
+
339
+ </ul>
340
+
341
+
342
+ <div id="constructor_details" class="method_details_list">
343
+ <h2>Constructor Details</h2>
344
+
345
+ <div class="method_details first">
346
+ <h3 class="signature first" id="initialize-instance_method">
347
+
348
+ #<strong>initialize</strong>(arel) &#x21d2; <tt><span class='object_link'><a href="" title="MultiTenant::ArelTenantVisitor (class)">ArelTenantVisitor</a></span></tt>
349
+
350
+
351
+
352
+
353
+
354
+ </h3><div class="docstring">
355
+ <div class="discussion">
356
+
357
+ <p>Returns a new instance of ArelTenantVisitor.</p>
358
+
359
+
360
+ </div>
361
+ </div>
362
+ <div class="tags">
363
+
364
+
365
+ </div><table class="source_code">
366
+ <tr>
367
+ <td>
368
+ <pre class="lines">
369
+
370
+
371
+ 66
372
+ 67
373
+ 68
374
+ 69
375
+ 70
376
+ 71
377
+ 72
378
+ 73</pre>
379
+ </td>
380
+ <td>
381
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 66</span>
382
+
383
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arel'>arel</span><span class='rparen'>)</span>
384
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_proc'>proc</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
385
+ <span class='ivar'>@statement_node_id</span> <span class='op'>=</span> <span class='kw'>nil</span>
386
+
387
+ <span class='ivar'>@contexts</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
388
+ <span class='ivar'>@current_context</span> <span class='op'>=</span> <span class='kw'>nil</span>
389
+ <span class='id identifier rubyid_accept'>accept</span><span class='lparen'>(</span><span class='id identifier rubyid_arel'>arel</span><span class='period'>.</span><span class='id identifier rubyid_ast'>ast</span><span class='rparen'>)</span>
390
+ <span class='kw'>end</span></pre>
391
+ </td>
392
+ </tr>
393
+ </table>
394
+ </div>
395
+
396
+ </div>
397
+
398
+ <div id="instance_attr_details" class="attr_details">
399
+ <h2>Instance Attribute Details</h2>
400
+
401
+
402
+ <span id=""></span>
403
+ <div class="method_details first">
404
+ <h3 class="signature first" id="contexts-instance_method">
405
+
406
+ #<strong>contexts</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
407
+
408
+
409
+
410
+
411
+
412
+ </h3><div class="docstring">
413
+ <div class="discussion">
414
+
415
+ <p>Returns the value of attribute contexts.</p>
416
+
417
+
418
+ </div>
419
+ </div>
420
+ <div class="tags">
421
+
422
+
423
+ </div><table class="source_code">
424
+ <tr>
425
+ <td>
426
+ <pre class="lines">
427
+
428
+
429
+ 75
430
+ 76
431
+ 77</pre>
432
+ </td>
433
+ <td>
434
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 75</span>
435
+
436
+ <span class='kw'>def</span> <span class='id identifier rubyid_contexts'>contexts</span>
437
+ <span class='ivar'>@contexts</span>
438
+ <span class='kw'>end</span></pre>
439
+ </td>
440
+ </tr>
441
+ </table>
442
+ </div>
443
+
444
+ </div>
445
+
446
+
447
+ <div id="instance_method_details" class="method_details_list">
448
+ <h2>Instance Method Details</h2>
449
+
450
+
451
+ <div class="method_details first">
452
+ <h3 class="signature first" id="visit_Arel_Attributes_Attribute-instance_method">
453
+
454
+ #<strong>visit_Arel_Attributes_Attribute</strong>(*args) &#x21d2; <tt>Object</tt>
455
+
456
+
457
+
458
+
459
+
460
+ </h3><div class="docstring">
461
+ <div class="discussion">
462
+
463
+ <p>rubocop:disable Naming/MethodName</p>
464
+
465
+
466
+ </div>
467
+ </div>
468
+ <div class="tags">
469
+
470
+
471
+ </div><table class="source_code">
472
+ <tr>
473
+ <td>
474
+ <pre class="lines">
475
+
476
+
477
+ 78
478
+ 79
479
+ 80
480
+ 81
481
+ 82</pre>
482
+ </td>
483
+ <td>
484
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 78</span>
485
+
486
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_Arel_Attributes_Attribute'>visit_Arel_Attributes_Attribute</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
487
+ <span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
488
+
489
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
490
+ <span class='kw'>end</span></pre>
491
+ </td>
492
+ </tr>
493
+ </table>
494
+ </div>
495
+
496
+ <div class="method_details ">
497
+ <h3 class="signature " id="visit_Arel_Nodes_Equality-instance_method">
498
+
499
+ #<strong>visit_Arel_Nodes_Equality</strong>(obj, *args) &#x21d2; <tt>Object</tt>
500
+
501
+
502
+
503
+
504
+
505
+ </h3><table class="source_code">
506
+ <tr>
507
+ <td>
508
+ <pre class="lines">
509
+
510
+
511
+ 84
512
+ 85
513
+ 86
514
+ 87
515
+ 88
516
+ 89
517
+ 90
518
+ 91
519
+ 92
520
+ 93</pre>
521
+ </td>
522
+ <td>
523
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 84</span>
524
+
525
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_Arel_Nodes_Equality'>visit_Arel_Nodes_Equality</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
526
+ <span class='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Arel</span><span class='op'>::</span><span class='const'>Attributes</span><span class='op'>::</span><span class='const'>Attribute</span><span class='rparen'>)</span>
527
+ <span class='id identifier rubyid_table_name'>table_name</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span>
528
+ <span class='id identifier rubyid_model'>model</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../MultiTenant.html" title="MultiTenant (module)">MultiTenant</a></span></span><span class='period'>.</span><span class='id identifier rubyid_multi_tenant_model_for_table'><span class='object_link'><a href="../MultiTenant.html#multi_tenant_model_for_table-class_method" title="MultiTenant.multi_tenant_model_for_table (method)">multi_tenant_model_for_table</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
529
+ <span class='kw'>if</span> <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>==</span> <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_partition_key'>partition_key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
530
+ <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_visited_handled_relation'>visited_handled_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_relation'>relation</span><span class='rparen'>)</span>
531
+ <span class='kw'>end</span>
532
+ <span class='kw'>end</span>
533
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
534
+ <span class='kw'>end</span></pre>
535
+ </td>
536
+ </tr>
537
+ </table>
538
+ </div>
539
+
540
+ <div class="method_details ">
541
+ <h3 class="signature " id="visit_Arel_Nodes_OuterJoin-instance_method">
542
+
543
+ #<strong>visit_Arel_Nodes_OuterJoin</strong>(obj, _collector = nil) &#x21d2; <tt>Object</tt>
544
+
545
+
546
+
547
+ <span class="aliases">Also known as:
548
+ <span class="names"><span id='visit_Arel_Nodes_FullOuterJoin-instance_method'>visit_Arel_Nodes_FullOuterJoin</span>, <span id='visit_Arel_Nodes_RightOuterJoin-instance_method'>visit_Arel_Nodes_RightOuterJoin</span></span>
549
+ </span>
550
+
551
+
552
+
553
+ </h3><div class="docstring">
554
+ <div class="discussion">
555
+
556
+ <p>rubocop:disable Naming/MethodName</p>
557
+
558
+
559
+ </div>
560
+ </div>
561
+ <div class="tags">
562
+
563
+
564
+ </div><table class="source_code">
565
+ <tr>
566
+ <td>
567
+ <pre class="lines">
568
+
569
+
570
+ 128
571
+ 129
572
+ 130
573
+ 131
574
+ 132
575
+ 133
576
+ 134
577
+ 135</pre>
578
+ </td>
579
+ <td>
580
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 128</span>
581
+
582
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_Arel_Nodes_OuterJoin'>visit_Arel_Nodes_OuterJoin</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='id identifier rubyid__collector'>_collector</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
583
+ <span class='id identifier rubyid_nest_context'>nest_context</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span> <span class='kw'>do</span>
584
+ <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_discover_relations'>discover_relations</span> <span class='kw'>do</span>
585
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span>
586
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_right'>right</span>
587
+ <span class='kw'>end</span>
588
+ <span class='kw'>end</span>
589
+ <span class='kw'>end</span></pre>
590
+ </td>
591
+ </tr>
592
+ </table>
593
+ </div>
594
+
595
+ <div class="method_details ">
596
+ <h3 class="signature " id="visit_Arel_Nodes_SelectCore-instance_method">
597
+
598
+ #<strong>visit_Arel_Nodes_SelectCore</strong>(obj, *_args) &#x21d2; <tt>Object</tt>
599
+
600
+
601
+
602
+
603
+
604
+ </h3><table class="source_code">
605
+ <tr>
606
+ <td>
607
+ <pre class="lines">
608
+
609
+
610
+ 109
611
+ 110
612
+ 111
613
+ 112
614
+ 113
615
+ 114
616
+ 115
617
+ 116
618
+ 117
619
+ 118
620
+ 119
621
+ 120
622
+ 121
623
+ 122
624
+ 123</pre>
625
+ </td>
626
+ <td>
627
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 109</span>
628
+
629
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_Arel_Nodes_SelectCore'>visit_Arel_Nodes_SelectCore</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid__args'>_args</span><span class='rparen'>)</span>
630
+ <span class='id identifier rubyid_nest_context'>nest_context</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span> <span class='kw'>do</span>
631
+ <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_discover_relations'>discover_relations</span> <span class='kw'>do</span>
632
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_source'>source</span>
633
+ <span class='kw'>end</span>
634
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_wheres'>wheres</span>
635
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_groups'>groups</span>
636
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_windows'>windows</span>
637
+ <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_having'>having</span><span class='rparen'>)</span>
638
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_having'>having</span>
639
+ <span class='kw'>else</span>
640
+ <span class='id identifier rubyid_visit'>visit</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_havings'>havings</span>
641
+ <span class='kw'>end</span>
642
+ <span class='kw'>end</span>
643
+ <span class='kw'>end</span></pre>
644
+ </td>
645
+ </tr>
646
+ </table>
647
+ </div>
648
+
649
+ <div class="method_details ">
650
+ <h3 class="signature " id="visit_Arel_Table-instance_method">
651
+
652
+ #<strong>visit_Arel_Table</strong>(obj, _collector = nil) &#x21d2; <tt>Object</tt>
653
+
654
+
655
+
656
+ <span class="aliases">Also known as:
657
+ <span class="names"><span id='visit_Arel_Nodes_TableAlias-instance_method'>visit_Arel_Nodes_TableAlias</span></span>
658
+ </span>
659
+
660
+
661
+
662
+ </h3><table class="source_code">
663
+ <tr>
664
+ <td>
665
+ <pre class="lines">
666
+
667
+
668
+ 103
669
+ 104
670
+ 105</pre>
671
+ </td>
672
+ <td>
673
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 103</span>
674
+
675
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_Arel_Table'>visit_Arel_Table</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='id identifier rubyid__collector'>_collector</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
676
+ <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_visited_relation'>visited_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_tenant_relation?'>tenant_relation?</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
677
+ <span class='kw'>end</span></pre>
678
+ </td>
679
+ </tr>
680
+ </table>
681
+ </div>
682
+
683
+ <div class="method_details ">
684
+ <h3 class="signature " id="visit_MultiTenant_TenantEnforcementClause-instance_method">
685
+
686
+ #<strong>visit_MultiTenant_TenantEnforcementClause</strong>(obj) &#x21d2; <tt>Object</tt>
687
+
688
+
689
+
690
+
691
+
692
+ </h3><table class="source_code">
693
+ <tr>
694
+ <td>
695
+ <pre class="lines">
696
+
697
+
698
+ 95
699
+ 96
700
+ 97</pre>
701
+ </td>
702
+ <td>
703
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 95</span>
704
+
705
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_MultiTenant_TenantEnforcementClause'>visit_MultiTenant_TenantEnforcementClause</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='op'>*</span><span class='rparen'>)</span>
706
+ <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_visited_handled_relation'>visited_handled_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_tenant_attribute'>tenant_attribute</span><span class='period'>.</span><span class='id identifier rubyid_relation'>relation</span><span class='rparen'>)</span>
707
+ <span class='kw'>end</span></pre>
708
+ </td>
709
+ </tr>
710
+ </table>
711
+ </div>
712
+
713
+ <div class="method_details ">
714
+ <h3 class="signature " id="visit_MultiTenant_TenantJoinEnforcementClause-instance_method">
715
+
716
+ #<strong>visit_MultiTenant_TenantJoinEnforcementClause</strong>(obj) &#x21d2; <tt>Object</tt>
717
+
718
+
719
+
720
+
721
+
722
+ </h3><table class="source_code">
723
+ <tr>
724
+ <td>
725
+ <pre class="lines">
726
+
727
+
728
+ 99
729
+ 100
730
+ 101</pre>
731
+ </td>
732
+ <td>
733
+ <pre class="code"><span class="info file"># File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 99</span>
734
+
735
+ <span class='kw'>def</span> <span class='id identifier rubyid_visit_MultiTenant_TenantJoinEnforcementClause'>visit_MultiTenant_TenantJoinEnforcementClause</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='op'>*</span><span class='rparen'>)</span>
736
+ <span class='ivar'>@current_context</span><span class='period'>.</span><span class='id identifier rubyid_visited_handled_relation'>visited_handled_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_tenant_attribute'>tenant_attribute</span><span class='period'>.</span><span class='id identifier rubyid_relation'>relation</span><span class='rparen'>)</span>
737
+ <span class='kw'>end</span></pre>
738
+ </td>
739
+ </tr>
740
+ </table>
741
+ </div>
742
+
743
+ </div>
744
+
745
+ </div>
746
+
747
+ <div id="footer">
748
+ Generated on Sat May 27 10:16:24 2023 by
749
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
750
+ 0.9.34 (ruby-3.2.2).
751
+ </div>
752
+
753
+ </div>
754
+ </body>
755
+ </html>