inquery 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a42f9f4e3765f6e9026a13c7e623c4a51787589171c40e128375382c44f2cde0
4
- data.tar.gz: 4bd9b28a6bc8a837e4efdf8845a13de1bf651382e4f609a855ba85a63bd65ad4
3
+ metadata.gz: 1196c966133abae58b4ba672eebc7fadf0852f4de0ff879673322bf6bfb4a285
4
+ data.tar.gz: 534d1e42f4df591e5cdb1e5e5995c8a3479f1afe03d6bb45d03773ad29c0838f
5
5
  SHA512:
6
- metadata.gz: 4ca5f8958bc74ebd0f2d67e7cc8a4dada0f981038ac486aa48da713988795390e99cf8ec49cb06df3aed5d18a7cec5c5923113c4a1e94da2184a4a027c5c4a20
7
- data.tar.gz: dfcee1dcdb1eaf602d434b45977bf70da0cb0486377079ca0d4c72637abbc6319f9d90c97891f012a8cf67584ef8520ec350d1afbacdd998ad044b6fcb2b45c7
6
+ metadata.gz: 31c7638d4a5eb7b32df879028bd01ee612254b1c34ffd2851be7851a5bb72488851748eba904ce6c7967e70e98ba4a85729960a00addd093ea622cdf96f3df30
7
+ data.tar.gz: 0fbe2057d13400d67546ee5722eb85b5e04cc794552c85043d3e939bc89cbd55eff247f8c4b28d681297d2e1305be32da61fc47d1c811868822cf2c36e9759ac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change log
2
2
 
3
+ ## 1.0.11 (2023-08-24)
4
+
5
+ * Add configuration option `config.default_schema_version` that allows you to
6
+ specify the schema version in effect when using the `schema` DSL method. For
7
+ backwards compatibility, this new setting defaults to `2`.
8
+
9
+ Internal reference: `#115859`.
10
+
3
11
  ## 1.0.10 (2022-05-19)
4
12
 
5
13
  * Update gem-internal ruby version and remove `bundler` from gemspec
@@ -38,7 +46,7 @@
38
46
 
39
47
  ## 1.0.3 (2020-05-12)
40
48
 
41
- - Overwrite parameter hash with the casted version if using
49
+ - Overwrite parameter hash with the casted version if using
42
50
  casting inside the schemacop `schema` block
43
51
 
44
52
  ## 1.0.2 (2019-10-09)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2016 - 2022 Sitrox
3
+ Copyright © 2016 - 2023 Sitrox
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -29,6 +29,7 @@ Inquery is tested with the following ruby versions:
29
29
  * 2.6.2
30
30
  * 2.7.1
31
31
  * 3.0.1
32
+ * 3.2.1
32
33
 
33
34
  Other ruby versions might work but are not covered by our automated tests.
34
35
 
@@ -297,7 +298,9 @@ end
297
298
  ```
298
299
 
299
300
  Inquery supports both schemacop specification versions 2 and 3 using the methods
300
- `schema` / `schema2` for version 2 and method `schema3` for version 3.
301
+ `schema2` for version 2 and method `schema3` for version 3. You can also use the
302
+ method `schema`, which defaults to the schema version configured using
303
+ `config.default_schema_version` (see [Configuration](#Configuration)).
301
304
 
302
305
  ## Rails integration
303
306
 
@@ -306,6 +309,18 @@ perfectly integrated into any Rails application. It has proven to be a winning
306
309
  concept to extract all complex queries into separate classes that are
307
310
  independently executable and testable.
308
311
 
312
+ ## Configuration
313
+
314
+ Inquery can be configured globally using an optional initializer:
315
+
316
+ ```ruby
317
+ # config/initializers/inquery.rb
318
+ Inquery.setup do |config|
319
+ # Specify the default schemacop schema version. Can be one of 2 or 3.
320
+ # config.default_schema_version = 2
321
+ end
322
+ ```
323
+
309
324
  ### Directory structure
310
325
 
311
326
  While not enforced, it is encouraged to use the following structure for storing
@@ -333,8 +348,9 @@ There are some key benefits to this approach:
333
348
  ## Contributors
334
349
 
335
350
  Thanks to Jeroen Weeink for his insights regarding using query classes as scopes
336
- in his [blog post](http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html).
351
+ in his [blog
352
+ post](http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html).
337
353
 
338
354
  ## Copyright
339
355
 
340
- Copyright © 2016 - 2022 Sitrox. See `LICENSE` for further details.
356
+ Copyright © 2016 - 2023 Sitrox. See `LICENSE` for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.10
1
+ 1.0.11
@@ -118,7 +118,7 @@
118
118
  </div>
119
119
 
120
120
  <div id="footer">
121
- Generated on Thu May 19 10:36:15 2022 by
121
+ Generated on Thu Aug 24 11:11:23 2023 by
122
122
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
123
  0.9.27 (ruby-3.0.1).
124
124
  </div>
@@ -122,7 +122,7 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Thu May 19 10:36:15 2022 by
125
+ Generated on Thu Aug 24 11:11:23 2023 by
126
126
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
127
  0.9.27 (ruby-3.0.1).
128
128
  </div>
@@ -122,7 +122,7 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Thu May 19 10:36:15 2022 by
125
+ Generated on Thu Aug 24 11:11:23 2023 by
126
126
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
127
  0.9.27 (ruby-3.0.1).
128
128
  </div>
@@ -105,7 +105,7 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Thu May 19 10:36:15 2022 by
108
+ Generated on Thu Aug 24 11:11:23 2023 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.9.27 (ruby-3.0.1).
111
111
  </div>
@@ -106,7 +106,7 @@
106
106
  </div>
107
107
 
108
108
  <div id="footer">
109
- Generated on Thu May 19 10:36:15 2022 by
109
+ Generated on Thu Aug 24 11:11:23 2023 by
110
110
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
111
111
  0.9.27 (ruby-3.0.1).
112
112
  </div>
@@ -178,7 +178,7 @@ on. See <span class='object_link'><a href="../RelationValidation.html#OPTIONS_SC
178
178
  </div>
179
179
 
180
180
  <div id="footer">
181
- Generated on Thu May 19 10:36:15 2022 by
181
+ Generated on Thu Aug 24 11:11:23 2023 by
182
182
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
183
183
  0.9.27 (ruby-3.0.1).
184
184
  </div>
@@ -325,7 +325,7 @@ options specified at class level using the <code>relation</code> method.</p>
325
325
  </div>
326
326
 
327
327
  <div id="footer">
328
- Generated on Thu May 19 10:36:15 2022 by
328
+ Generated on Thu Aug 24 11:11:23 2023 by
329
329
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
330
330
  0.9.27 (ruby-3.0.1).
331
331
  </div>
@@ -206,13 +206,27 @@
206
206
 
207
207
  25
208
208
  26
209
- 27</pre>
209
+ 27
210
+ 28
211
+ 29
212
+ 30
213
+ 31
214
+ 32
215
+ 33
216
+ 34</pre>
210
217
  </td>
211
218
  <td>
212
219
  <pre class="code"><span class="info file"># File 'lib/inquery/mixins/schema_validation.rb', line 25</span>
213
220
 
214
221
  <span class='kw'>def</span> <span class='id identifier rubyid_schema'>schema</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
215
- <span class='id identifier rubyid_schema2'>schema2</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
222
+ <span class='kw'>case</span> <span class='const'><span class='object_link'><a href="../../../Inquery.html" title="Inquery (module)">Inquery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_default_schema_version'>default_schema_version</span>
223
+ <span class='kw'>when</span> <span class='int'>2</span>
224
+ <span class='id identifier rubyid_schema2'>schema2</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
225
+ <span class='kw'>when</span> <span class='int'>3</span>
226
+ <span class='id identifier rubyid_schema3'>schema3</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
227
+ <span class='kw'>else</span>
228
+ <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Schemacop schema versions supported are 2 and 3.</span><span class='tstring_end'>&#39;</span></span>
229
+ <span class='kw'>end</span>
216
230
  <span class='kw'>end</span></pre>
217
231
  </td>
218
232
  </tr>
@@ -292,7 +306,7 @@
292
306
  </div>
293
307
 
294
308
  <div id="footer">
295
- Generated on Thu May 19 10:36:15 2022 by
309
+ Generated on Thu Aug 24 11:11:23 2023 by
296
310
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
297
311
  0.9.27 (ruby-3.0.1).
298
312
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Thu May 19 10:36:15 2022 by
119
+ Generated on Thu Aug 24 11:11:23 2023 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.9.27 (ruby-3.0.1).
122
122
  </div>
@@ -107,7 +107,7 @@
107
107
  </div>
108
108
 
109
109
  <div id="footer">
110
- Generated on Thu May 19 10:36:15 2022 by
110
+ Generated on Thu Aug 24 11:11:23 2023 by
111
111
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
112
  0.9.27 (ruby-3.0.1).
113
113
  </div>
@@ -529,7 +529,7 @@
529
529
  </div>
530
530
 
531
531
  <div id="footer">
532
- Generated on Thu May 19 10:36:15 2022 by
532
+ Generated on Thu Aug 24 11:11:23 2023 by
533
533
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
534
534
  0.9.27 (ruby-3.0.1).
535
535
  </div>
@@ -779,7 +779,7 @@ easyer access.</p>
779
779
  </div>
780
780
 
781
781
  <div id="footer">
782
- Generated on Thu May 19 10:36:15 2022 by
782
+ Generated on Thu Aug 24 11:11:23 2023 by
783
783
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
784
784
  0.9.27 (ruby-3.0.1).
785
785
  </div>
data/doc/Inquery.html CHANGED
@@ -104,12 +104,124 @@
104
104
 
105
105
 
106
106
 
107
+
108
+ <h2>
109
+ Class Method Summary
110
+ <small><a href="#" class="summary_toggle">collapse</a></small>
111
+ </h2>
112
+
113
+ <ul class="summary">
114
+
115
+ <li class="public ">
116
+ <span class="summary_signature">
117
+
118
+ <a href="#setup-class_method" title="setup (class method)">.<strong>setup</strong> {|_self| ... } &#x21d2; Object </a>
119
+
120
+
121
+
122
+ </span>
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+ <span class="summary_desc"><div class='inline'><p>Setup method that should be called in a dedicated initializer.</p>
133
+ </div></span>
134
+
135
+ </li>
136
+
137
+
138
+ </ul>
139
+
140
+
141
+
107
142
 
143
+ <div id="class_method_details" class="method_details_list">
144
+ <h2>Class Method Details</h2>
145
+
146
+
147
+ <div class="method_details first">
148
+ <h3 class="signature first" id="setup-class_method">
149
+
150
+ .<strong>setup</strong> {|_self| ... } &#x21d2; <tt>Object</tt>
151
+
152
+
153
+
154
+
155
+
156
+ </h3><div class="docstring">
157
+ <div class="discussion">
158
+ <p>Setup method that should be called in a dedicated initializer.</p>
159
+
160
+
161
+ </div>
162
+ </div>
163
+ <div class="tags">
164
+
165
+ <p class="tag_title">Yields:</p>
166
+ <ul class="yield">
167
+
168
+ <li>
169
+
170
+
171
+ <span class='type'>(<tt>_self</tt>)</span>
172
+
173
+
174
+
175
+ </li>
176
+
177
+ </ul>
178
+ <p class="tag_title">Yield Parameters:</p>
179
+ <ul class="yieldparam">
180
+
181
+ <li>
182
+
183
+ <span class='name'>_self</span>
184
+
185
+
186
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Inquery (module)">Inquery</a></span></tt>)</span>
187
+
188
+
189
+
190
+ &mdash;
191
+ <div class='inline'><p>the object that the method was called on</p>
192
+ </div>
193
+
194
+ </li>
195
+
196
+ </ul>
197
+
198
+ </div><table class="source_code">
199
+ <tr>
200
+ <td>
201
+ <pre class="lines">
202
+
203
+
204
+ 6
205
+ 7
206
+ 8</pre>
207
+ </td>
208
+ <td>
209
+ <pre class="code"><span class="info file"># File 'lib/inquery.rb', line 6</span>
210
+
211
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_setup'>setup</span>
212
+ <span class='kw'>yield</span> <span class='kw'>self</span>
213
+ <span class='kw'>end</span></pre>
214
+ </td>
215
+ </tr>
216
+ </table>
217
+ </div>
218
+
219
+ </div>
108
220
 
109
221
  </div>
110
222
 
111
223
  <div id="footer">
112
- Generated on Thu May 19 10:36:15 2022 by
224
+ Generated on Thu Aug 24 11:11:23 2023 by
113
225
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
114
226
  0.9.27 (ruby-3.0.1).
115
227
  </div>
data/doc/_index.html CHANGED
@@ -248,7 +248,7 @@
248
248
  </div>
249
249
 
250
250
  <div id="footer">
251
- Generated on Thu May 19 10:36:15 2022 by
251
+ Generated on Thu Aug 24 11:11:23 2023 by
252
252
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
253
253
  0.9.27 (ruby-3.0.1).
254
254
  </div>
data/doc/file.README.html CHANGED
@@ -87,6 +87,7 @@ to your <code>Gemfile</code>:</p>
87
87
  <li>2.6.2</li>
88
88
  <li>2.7.1</li>
89
89
  <li>3.0.1</li>
90
+ <li>3.2.1</li>
90
91
  </ul>
91
92
 
92
93
  <p>Other ruby versions might work but are not covered by our automated tests.</p>
@@ -343,7 +344,9 @@ access.</p>
343
344
  </code></pre>
344
345
 
345
346
  <p>Inquery supports both schemacop specification versions 2 and 3 using the methods
346
- <code>schema</code> / <code>schema2</code> for version 2 and method <code>schema3</code> for version 3.</p>
347
+ <code>schema2</code> for version 2 and method <code>schema3</code> for version 3. You can also use the
348
+ method <code>schema</code>, which defaults to the schema version configured using
349
+ <code>config.default_schema_version</code> (see <a href="#Configuration">Configuration</a>).</p>
347
350
 
348
351
  <h2 id="rails-integration">Rails integration</h2>
349
352
 
@@ -352,6 +355,17 @@ perfectly integrated into any Rails application. It has proven to be a winning
352
355
  concept to extract all complex queries into separate classes that are
353
356
  independently executable and testable.</p>
354
357
 
358
+ <h2 id="configuration">Configuration</h2>
359
+
360
+ <p>Inquery can be configured globally using an optional initializer:</p>
361
+
362
+ <pre class="code ruby"><code class="ruby"><span class='comment'># config/initializers/inquery.rb
363
+ </span><span class='const'><span class='object_link'><a href="Inquery.html" title="Inquery (module)">Inquery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_setup'><span class='object_link'><a href="Inquery.html#setup-class_method" title="Inquery.setup (method)">setup</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
364
+ <span class='comment'># Specify the default schemacop schema version. Can be one of 2 or 3.
365
+ </span> <span class='comment'># config.default_schema_version = 2
366
+ </span><span class='kw'>end</span>
367
+ </code></pre>
368
+
355
369
  <h3 id="directory-structure">Directory structure</h3>
356
370
 
357
371
  <p>While not enforced, it is encouraged to use the following structure for storing
@@ -383,15 +397,16 @@ query classes.</li>
383
397
  <h2 id="contributors">Contributors</h2>
384
398
 
385
399
  <p>Thanks to Jeroen Weeink for his insights regarding using query classes as scopes
386
- in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog post</a>.</p>
400
+ in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog
401
+ post</a>.</p>
387
402
 
388
403
  <h2 id="copyright">Copyright</h2>
389
404
 
390
- <p>Copyright © 2016 - 2022 Sitrox. See <code>LICENSE</code> for further details.</p>
405
+ <p>Copyright © 2016 - 2023 Sitrox. See <code>LICENSE</code> for further details.</p>
391
406
  </div></div>
392
407
 
393
408
  <div id="footer">
394
- Generated on Thu May 19 10:36:15 2022 by
409
+ Generated on Thu Aug 24 11:11:23 2023 by
395
410
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
396
411
  0.9.27 (ruby-3.0.1).
397
412
  </div>
data/doc/index.html CHANGED
@@ -87,6 +87,7 @@ to your <code>Gemfile</code>:</p>
87
87
  <li>2.6.2</li>
88
88
  <li>2.7.1</li>
89
89
  <li>3.0.1</li>
90
+ <li>3.2.1</li>
90
91
  </ul>
91
92
 
92
93
  <p>Other ruby versions might work but are not covered by our automated tests.</p>
@@ -343,7 +344,9 @@ access.</p>
343
344
  </code></pre>
344
345
 
345
346
  <p>Inquery supports both schemacop specification versions 2 and 3 using the methods
346
- <code>schema</code> / <code>schema2</code> for version 2 and method <code>schema3</code> for version 3.</p>
347
+ <code>schema2</code> for version 2 and method <code>schema3</code> for version 3. You can also use the
348
+ method <code>schema</code>, which defaults to the schema version configured using
349
+ <code>config.default_schema_version</code> (see <a href="#Configuration">Configuration</a>).</p>
347
350
 
348
351
  <h2 id="rails-integration">Rails integration</h2>
349
352
 
@@ -352,6 +355,17 @@ perfectly integrated into any Rails application. It has proven to be a winning
352
355
  concept to extract all complex queries into separate classes that are
353
356
  independently executable and testable.</p>
354
357
 
358
+ <h2 id="configuration">Configuration</h2>
359
+
360
+ <p>Inquery can be configured globally using an optional initializer:</p>
361
+
362
+ <pre class="code ruby"><code class="ruby"><span class='comment'># config/initializers/inquery.rb
363
+ </span><span class='const'><span class='object_link'><a href="Inquery.html" title="Inquery (module)">Inquery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_setup'><span class='object_link'><a href="Inquery.html#setup-class_method" title="Inquery.setup (method)">setup</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
364
+ <span class='comment'># Specify the default schemacop schema version. Can be one of 2 or 3.
365
+ </span> <span class='comment'># config.default_schema_version = 2
366
+ </span><span class='kw'>end</span>
367
+ </code></pre>
368
+
355
369
  <h3 id="directory-structure">Directory structure</h3>
356
370
 
357
371
  <p>While not enforced, it is encouraged to use the following structure for storing
@@ -383,15 +397,16 @@ query classes.</li>
383
397
  <h2 id="contributors">Contributors</h2>
384
398
 
385
399
  <p>Thanks to Jeroen Weeink for his insights regarding using query classes as scopes
386
- in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog post</a>.</p>
400
+ in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog
401
+ post</a>.</p>
387
402
 
388
403
  <h2 id="copyright">Copyright</h2>
389
404
 
390
- <p>Copyright © 2016 - 2022 Sitrox. See <code>LICENSE</code> for further details.</p>
405
+ <p>Copyright © 2016 - 2023 Sitrox. See <code>LICENSE</code> for further details.</p>
391
406
  </div></div>
392
407
 
393
408
  <div id="footer">
394
- Generated on Thu May 19 10:36:15 2022 by
409
+ Generated on Thu Aug 24 11:11:23 2023 by
395
410
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
396
411
  0.9.27 (ruby-3.0.1).
397
412
  </div>
data/doc/method_list.html CHANGED
@@ -46,32 +46,32 @@
46
46
 
47
47
  <li class="odd ">
48
48
  <div class="item">
49
- <span class='object_link'><a href="Inquery/Query/Chainable.html#call-instance_method" title="Inquery::Query::Chainable#call (method)">#call</a></span>
50
- <small>Inquery::Query::Chainable</small>
49
+ <span class='object_link'><a href="Inquery/Query.html#call-instance_method" title="Inquery::Query#call (method)">#call</a></span>
50
+ <small>Inquery::Query</small>
51
51
  </div>
52
52
  </li>
53
53
 
54
54
 
55
55
  <li class="even ">
56
56
  <div class="item">
57
- <span class='object_link'><a href="Inquery/Query.html#call-instance_method" title="Inquery::Query#call (method)">#call</a></span>
58
- <small>Inquery::Query</small>
57
+ <span class='object_link'><a href="Inquery/Query/Chainable.html#call-instance_method" title="Inquery::Query::Chainable#call (method)">#call</a></span>
58
+ <small>Inquery::Query::Chainable</small>
59
59
  </div>
60
60
  </li>
61
61
 
62
62
 
63
63
  <li class="odd ">
64
64
  <div class="item">
65
- <span class='object_link'><a href="Inquery/Query.html#call-class_method" title="Inquery::Query.call (method)">call</a></span>
66
- <small>Inquery::Query</small>
65
+ <span class='object_link'><a href="Inquery/Query/Chainable.html#call-class_method" title="Inquery::Query::Chainable.call (method)">call</a></span>
66
+ <small>Inquery::Query::Chainable</small>
67
67
  </div>
68
68
  </li>
69
69
 
70
70
 
71
71
  <li class="even ">
72
72
  <div class="item">
73
- <span class='object_link'><a href="Inquery/Query/Chainable.html#call-class_method" title="Inquery::Query::Chainable.call (method)">call</a></span>
74
- <small>Inquery::Query::Chainable</small>
73
+ <span class='object_link'><a href="Inquery/Query.html#call-class_method" title="Inquery::Query.call (method)">call</a></span>
74
+ <small>Inquery::Query</small>
75
75
  </div>
76
76
  </li>
77
77
 
@@ -134,16 +134,16 @@
134
134
 
135
135
  <li class="even ">
136
136
  <div class="item">
137
- <span class='object_link'><a href="Inquery/Query/Chainable.html#relation-instance_method" title="Inquery::Query::Chainable#relation (method)">#relation</a></span>
138
- <small>Inquery::Query::Chainable</small>
137
+ <span class='object_link'><a href="Inquery/Mixins/RelationValidation/ClassMethods.html#relation-instance_method" title="Inquery::Mixins::RelationValidation::ClassMethods#relation (method)">#relation</a></span>
138
+ <small>Inquery::Mixins::RelationValidation::ClassMethods</small>
139
139
  </div>
140
140
  </li>
141
141
 
142
142
 
143
143
  <li class="odd ">
144
144
  <div class="item">
145
- <span class='object_link'><a href="Inquery/Mixins/RelationValidation/ClassMethods.html#relation-instance_method" title="Inquery::Mixins::RelationValidation::ClassMethods#relation (method)">#relation</a></span>
146
- <small>Inquery::Mixins::RelationValidation::ClassMethods</small>
145
+ <span class='object_link'><a href="Inquery/Query/Chainable.html#relation-instance_method" title="Inquery::Query::Chainable#relation (method)">#relation</a></span>
146
+ <small>Inquery::Query::Chainable</small>
147
147
  </div>
148
148
  </li>
149
149
 
@@ -189,6 +189,14 @@
189
189
 
190
190
 
191
191
  <li class="odd ">
192
+ <div class="item">
193
+ <span class='object_link'><a href="Inquery.html#setup-class_method" title="Inquery.setup (method)">setup</a></span>
194
+ <small>Inquery</small>
195
+ </div>
196
+ </li>
197
+
198
+
199
+ <li class="even ">
192
200
  <div class="item">
193
201
  <span class='object_link'><a href="Inquery/Mixins/RelationValidation.html#validate_relation!-instance_method" title="Inquery::Mixins::RelationValidation#validate_relation! (method)">#validate_relation!</a></span>
194
202
  <small>Inquery::Mixins::RelationValidation</small>
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Thu May 19 10:36:15 2022 by
103
+ Generated on Thu Aug 24 11:11:23 2023 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.27 (ruby-3.0.1).
106
106
  </div>
data/inquery.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: inquery 1.0.10 ruby lib
2
+ # stub: inquery 1.0.11 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "inquery".freeze
6
- s.version = "1.0.10"
6
+ s.version = "1.0.11"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Sitrox".freeze]
11
- s.date = "2022-05-19"
11
+ s.date = "2023-08-24"
12
12
  s.files = [".github/workflows/rubocop.yml".freeze, ".github/workflows/ruby.yml".freeze, ".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, ".yardopts".freeze, "Appraisals".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "RUBY_VERSION".freeze, "Rakefile".freeze, "VERSION".freeze, "doc/Inquery.html".freeze, "doc/Inquery/Exceptions.html".freeze, "doc/Inquery/Exceptions/Base.html".freeze, "doc/Inquery/Exceptions/InvalidRelation.html".freeze, "doc/Inquery/Exceptions/UnknownCallSignature.html".freeze, "doc/Inquery/Mixins.html".freeze, "doc/Inquery/Mixins/RawSqlUtils.html".freeze, "doc/Inquery/Mixins/RelationValidation.html".freeze, "doc/Inquery/Mixins/RelationValidation/ClassMethods.html".freeze, "doc/Inquery/Mixins/SchemaValidation.html".freeze, "doc/Inquery/Mixins/SchemaValidation/ClassMethods.html".freeze, "doc/Inquery/Query.html".freeze, "doc/Inquery/Query/Chainable.html".freeze, "doc/_index.html".freeze, "doc/class_list.html".freeze, "doc/css/common.css".freeze, "doc/css/full_list.css".freeze, "doc/css/style.css".freeze, "doc/file.README.html".freeze, "doc/file_list.html".freeze, "doc/frames.html".freeze, "doc/index.html".freeze, "doc/js/app.js".freeze, "doc/js/full_list.js".freeze, "doc/js/jquery.js".freeze, "doc/method_list.html".freeze, "doc/top-level-namespace.html".freeze, "gemfiles/rails_5.1.gemfile".freeze, "gemfiles/rails_5.2.gemfile".freeze, "gemfiles/rails_6.0.gemfile".freeze, "gemfiles/rails_6.1.gemfile".freeze, "gemfiles/rails_7.0.gemfile".freeze, "inquery.gemspec".freeze, "lib/inquery.rb".freeze, "lib/inquery/exceptions.rb".freeze, "lib/inquery/mixins/raw_sql_utils.rb".freeze, "lib/inquery/mixins/relation_validation.rb".freeze, "lib/inquery/mixins/schema_validation.rb".freeze, "lib/inquery/query.rb".freeze, "lib/inquery/query/chainable.rb".freeze, "test/db/models.rb".freeze, "test/db/schema.rb".freeze, "test/inquery/query/chainable_test.rb".freeze, "test/inquery/query_test.rb".freeze, "test/queries/group/fetch_as_json.rb".freeze, "test/queries/group/fetch_green.rb".freeze, "test/queries/group/fetch_red.rb".freeze, "test/queries/group/filter_with_color.rb".freeze, "test/queries/user/fetch_all.rb".freeze, "test/queries/user/fetch_in_group.rb".freeze, "test/queries/user/fetch_in_group_rel.rb".freeze, "test/test_helper.rb".freeze]
13
13
  s.rubygems_version = "3.2.16".freeze
14
14
  s.summary = "A skeleton that allows extracting queries into atomic, reusable classes.".freeze
@@ -23,7 +23,14 @@ module Inquery
23
23
 
24
24
  # @see schema2
25
25
  def schema(*args, &block)
26
- schema2(*args, &block)
26
+ case Inquery.default_schema_version
27
+ when 2
28
+ schema2(*args, &block)
29
+ when 3
30
+ schema3(*args, &block)
31
+ else
32
+ fail 'Schemacop schema versions supported are 2 and 3.'
33
+ end
27
34
  end
28
35
  end
29
36
  end
data/lib/inquery.rb CHANGED
@@ -1,4 +1,11 @@
1
1
  module Inquery
2
+ mattr_accessor :default_schema_version
3
+ self.default_schema_version = 2
4
+
5
+ # Setup method that should be called in a dedicated initializer.
6
+ def self.setup
7
+ yield self
8
+ end
2
9
  end
3
10
 
4
11
  require 'uri'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-19 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  - !ruby/object:Gem::Version
255
255
  version: '0'
256
256
  requirements: []
257
- rubygems_version: 3.3.11
257
+ rubygems_version: 3.4.10
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: A skeleton that allows extracting queries into atomic, reusable classes.