inquery 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,7 +43,7 @@
43
43
 
44
44
  <ul id="full_list" class="class">
45
45
  <li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
46
- <li id='object_Inquery' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="Inquery.html" title="Inquery (module)">Inquery</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_Inquery::Exceptions' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Exceptions.html" title="Inquery::Exceptions (module)">Exceptions</a></span><small class='search_info'>Inquery</small></div><ul><li id='object_Inquery::Exceptions::Base' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Exceptions/Base.html" title="Inquery::Exceptions::Base (class)">Base</a></span> &lt; StandardError<small class='search_info'>Inquery::Exceptions</small></div></li><li id='object_Inquery::Exceptions::InvalidRelation' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Exceptions/InvalidRelation.html" title="Inquery::Exceptions::InvalidRelation (class)">InvalidRelation</a></span> &lt; Base<small class='search_info'>Inquery::Exceptions</small></div></li><li id='object_Inquery::Exceptions::UnknownCallSignature' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Exceptions/UnknownCallSignature.html" title="Inquery::Exceptions::UnknownCallSignature (class)">UnknownCallSignature</a></span> &lt; Base<small class='search_info'>Inquery::Exceptions</small></div></li></ul></li><li id='object_Inquery::Mixins' class='collapsed even'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Mixins.html" title="Inquery::Mixins (module)">Mixins</a></span><small class='search_info'>Inquery</small></div><ul><li id='object_Inquery::Mixins::RelationValidation' class='collapsed'><div class='item' style='padding-left:60px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Mixins/RelationValidation.html" title="Inquery::Mixins::RelationValidation (module)">RelationValidation</a></span><small class='search_info'>Inquery::Mixins</small></div><ul><li id='object_Inquery::Mixins::RelationValidation::ClassMethods' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="Inquery/Mixins/RelationValidation/ClassMethods.html" title="Inquery::Mixins::RelationValidation::ClassMethods (module)">ClassMethods</a></span><small class='search_info'>Inquery::Mixins::RelationValidation</small></div></li></ul></li><li id='object_Inquery::Mixins::SchemaValidation' class='collapsed'><div class='item' style='padding-left:60px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Mixins/SchemaValidation.html" title="Inquery::Mixins::SchemaValidation (module)">SchemaValidation</a></span><small class='search_info'>Inquery::Mixins</small></div><ul><li id='object_Inquery::Mixins::SchemaValidation::ClassMethods' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="Inquery/Mixins/SchemaValidation/ClassMethods.html" title="Inquery::Mixins::SchemaValidation::ClassMethods (module)">ClassMethods</a></span><small class='search_info'>Inquery::Mixins::SchemaValidation</small></div></li></ul></li></ul></li><li id='object_Inquery::Query' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Query.html" title="Inquery::Query (class)">Query</a></span> &lt; Object<small class='search_info'>Inquery</small></div><ul><li id='object_Inquery::Query::Chainable' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Query/Chainable.html" title="Inquery::Query::Chainable (class)">Chainable</a></span> &lt; Query<small class='search_info'>Inquery::Query</small></div></li></ul></li></ul></li>
46
+ <li id='object_Inquery' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="Inquery.html" title="Inquery (module)">Inquery</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_Inquery::Exceptions' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Exceptions.html" title="Inquery::Exceptions (module)">Exceptions</a></span><small class='search_info'>Inquery</small></div><ul><li id='object_Inquery::Exceptions::Base' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Exceptions/Base.html" title="Inquery::Exceptions::Base (class)">Base</a></span> &lt; StandardError<small class='search_info'>Inquery::Exceptions</small></div></li><li id='object_Inquery::Exceptions::InvalidRelation' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Exceptions/InvalidRelation.html" title="Inquery::Exceptions::InvalidRelation (class)">InvalidRelation</a></span> &lt; Base<small class='search_info'>Inquery::Exceptions</small></div></li><li id='object_Inquery::Exceptions::UnknownCallSignature' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Exceptions/UnknownCallSignature.html" title="Inquery::Exceptions::UnknownCallSignature (class)">UnknownCallSignature</a></span> &lt; Base<small class='search_info'>Inquery::Exceptions</small></div></li></ul></li><li id='object_Inquery::Mixins' class='collapsed even'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Mixins.html" title="Inquery::Mixins (module)">Mixins</a></span><small class='search_info'>Inquery</small></div><ul><li id='object_Inquery::Mixins::RawSqlUtils' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Mixins/RawSqlUtils.html" title="Inquery::Mixins::RawSqlUtils (module)">RawSqlUtils</a></span><small class='search_info'>Inquery::Mixins</small></div></li><li id='object_Inquery::Mixins::RelationValidation' class='collapsed'><div class='item' style='padding-left:60px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Mixins/RelationValidation.html" title="Inquery::Mixins::RelationValidation (module)">RelationValidation</a></span><small class='search_info'>Inquery::Mixins</small></div><ul><li id='object_Inquery::Mixins::RelationValidation::ClassMethods' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="Inquery/Mixins/RelationValidation/ClassMethods.html" title="Inquery::Mixins::RelationValidation::ClassMethods (module)">ClassMethods</a></span><small class='search_info'>Inquery::Mixins::RelationValidation</small></div></li></ul></li><li id='object_Inquery::Mixins::SchemaValidation' class='collapsed'><div class='item' style='padding-left:60px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Mixins/SchemaValidation.html" title="Inquery::Mixins::SchemaValidation (module)">SchemaValidation</a></span><small class='search_info'>Inquery::Mixins</small></div><ul><li id='object_Inquery::Mixins::SchemaValidation::ClassMethods' class='collapsed'><div class='item' style='padding-left:75px'><span class='object_link'><a href="Inquery/Mixins/SchemaValidation/ClassMethods.html" title="Inquery::Mixins::SchemaValidation::ClassMethods (module)">ClassMethods</a></span><small class='search_info'>Inquery::Mixins::SchemaValidation</small></div></li></ul></li></ul></li><li id='object_Inquery::Query' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Inquery/Query.html" title="Inquery::Query (class)">Query</a></span> &lt; Object<small class='search_info'>Inquery</small></div><ul><li id='object_Inquery::Query::Chainable' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Inquery/Query/Chainable.html" title="Inquery::Query::Chainable (class)">Chainable</a></span> &lt; Query<small class='search_info'>Inquery::Query</small></div></li></ul></li></ul></li>
47
47
 
48
48
  </ul>
49
49
  </div>
@@ -245,6 +245,7 @@ ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
245
245
 
246
246
  dl.constants { margin-left: 10px; }
247
247
  dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
248
+ dl.constants.compact dt { display: inline-block; font-weight: normal }
248
249
  dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
249
250
  dl.constants .docstring .note:first-child { margin-top: 5px; }
250
251
 
@@ -326,13 +327,9 @@ ul.summary a, ul.summary a:visited {
326
327
  text-decoration: none; font-size: 1.1em;
327
328
  }
328
329
  ul.summary li { margin-bottom: 5px; }
329
- .summary .summary_signature {
330
- padding: 4px 8px;
331
- background: #f8f8f8;
332
- border: 1px solid #f0f0f0;
333
- border-radius: 5px;
334
- }
330
+ .summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; }
335
331
  .summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; }
332
+ .summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; }
336
333
  ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
337
334
  ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
338
335
  #content .summary_signature:hover a,
@@ -484,6 +481,13 @@ pre.code .rubyid_backref,
484
481
  pre.code .rubyid_nth_ref { color: #6D79DE; }
485
482
  pre.code .regexp, .dregexp { color: #036A07; }
486
483
  pre.code a { border-bottom: 1px dotted #bbf; }
484
+ /* inline code */
485
+ *:not(pre) > code {
486
+ padding: 1px 3px 1px 3px;
487
+ border: 1px solid #E1E1E8;
488
+ background: #F7F7F9;
489
+ border-radius: 4px;
490
+ }
487
491
 
488
492
  /* Color fix for links */
489
493
  #content .summary_desc pre.code .id > .object_link a, /* identifier */
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.9
9
+ &mdash; Documentation by YARD 0.9.20
10
10
 
11
11
  </title>
12
12
 
@@ -141,6 +141,36 @@ the <code>call</code> and optionally the <code>process</code> method:</p>
141
141
  <p>Note that it&#39;s perfectly fine for some queries to return <code>nil</code>, i.e. if they&#39;re
142
142
  writing queries that don&#39;t fetch any results.</p>
143
143
 
144
+ <h3>Using raw SQL</h3>
145
+
146
+ <p>In some cases it may make sense to push down all computation to the database and
147
+ only construct an SQL query for this purpose. To facilitate this,
148
+ <span class='object_link'><a href="Inquery/Query.html" title="Inquery::Query (class)">Inquery::Query</a></span> provides sanitization and query execution methods:</p>
149
+
150
+ <pre class="code ruby"><code class="ruby"><span class='comment'># Note: There are better ways of achieving the same result, this is an example
151
+ </span><span class='comment'># to demonstrate the methods.
152
+ </span><span class='kw'>class</span> <span class='const'>CheckIfSold</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="Inquery.html" title="Inquery (module)">Inquery</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Inquery/Query.html" title="Inquery::Query (class)">Query</a></span></span>
153
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
154
+ <span class='id identifier rubyid_parts'>parts</span> <span class='op'>=</span> <span class='lbracket'>[</span>
155
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SELECT car_id FROM dealership_sales</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
156
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SELECT car_id FROM dealership_leasings</span><span class='tstring_end'>&#39;</span></span>
157
+ <span class='rbracket'>]</span>
158
+
159
+ <span class='id identifier rubyid_sql'>sql</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SELECT ? IN (</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_parts'>parts</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> UNION </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>)</span><span class='tstring_end'>&#39;</span></span>
160
+
161
+ <span class='comment'># The &#39;san&#39; method takes n+1 arguments: The SQL string and n parameters
162
+ </span> <span class='id identifier rubyid_sanitized_sql'>sanitized_sql</span> <span class='op'>=</span> <span class='id identifier rubyid_san'>san</span><span class='lparen'>(</span><span class='id identifier rubyid_sql'>sql</span><span class='comma'>,</span> <span class='id identifier rubyid_osparams'>osparams</span><span class='period'>.</span><span class='id identifier rubyid_car_id'>car_id</span><span class='rparen'>)</span>
163
+
164
+ <span class='comment'># Returns instance of ActiveRecord::Result
165
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_exec_query'>exec_query</span><span class='lparen'>(</span><span class='id identifier rubyid_sanitized_sql'>sanitized_sql</span><span class='rparen'>)</span>
166
+ <span class='kw'>end</span>
167
+
168
+ <span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
169
+ <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
170
+ <span class='kw'>end</span>
171
+ <span class='kw'>end</span>
172
+ </code></pre>
173
+
144
174
  <h2>Chainable queries</h2>
145
175
 
146
176
  <p>Chainable queries are queries that input and output an Active Record relation.
@@ -336,18 +366,17 @@ query classes.</li>
336
366
  <h2>Contributors</h2>
337
367
 
338
368
  <p>Thanks to Jeroen Weeink for his insights regarding using query classes as scopes
339
- in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog post</a>.
340
- And special thanks to <a href="http://www.subgit.com/">SubGit</a> for their great open source licensing.</p>
369
+ in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog post</a>.</p>
341
370
 
342
371
  <h2>Copyright</h2>
343
372
 
344
- <p>Copyright (c) 2017 Sitrox. See <code>LICENSE</code> for further details.</p>
373
+ <p>Copyright (c) 2019 Sitrox. See <code>LICENSE</code> for further details.</p>
345
374
  </div></div>
346
375
 
347
376
  <div id="footer">
348
- Generated on Wed May 17 12:30:38 2017 by
377
+ Generated on Wed Oct 9 16:20:53 2019 by
349
378
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
350
- 0.9.9 (ruby-2.3.1).
379
+ 0.9.20 (ruby-2.6.2).
351
380
  </div>
352
381
 
353
382
  </div>
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Documentation by YARD 0.9.9</title>
5
+ <title>Documentation by YARD 0.9.20</title>
6
6
  </head>
7
7
  <script type="text/javascript" charset="utf-8">
8
8
  var match = unescape(window.location.hash).match(/^#!(.+)/);
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.9
9
+ &mdash; Documentation by YARD 0.9.20
10
10
 
11
11
  </title>
12
12
 
@@ -141,6 +141,36 @@ the <code>call</code> and optionally the <code>process</code> method:</p>
141
141
  <p>Note that it&#39;s perfectly fine for some queries to return <code>nil</code>, i.e. if they&#39;re
142
142
  writing queries that don&#39;t fetch any results.</p>
143
143
 
144
+ <h3>Using raw SQL</h3>
145
+
146
+ <p>In some cases it may make sense to push down all computation to the database and
147
+ only construct an SQL query for this purpose. To facilitate this,
148
+ <span class='object_link'><a href="Inquery/Query.html" title="Inquery::Query (class)">Inquery::Query</a></span> provides sanitization and query execution methods:</p>
149
+
150
+ <pre class="code ruby"><code class="ruby"><span class='comment'># Note: There are better ways of achieving the same result, this is an example
151
+ </span><span class='comment'># to demonstrate the methods.
152
+ </span><span class='kw'>class</span> <span class='const'>CheckIfSold</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="Inquery.html" title="Inquery (module)">Inquery</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Inquery/Query.html" title="Inquery::Query (class)">Query</a></span></span>
153
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
154
+ <span class='id identifier rubyid_parts'>parts</span> <span class='op'>=</span> <span class='lbracket'>[</span>
155
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SELECT car_id FROM dealership_sales</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
156
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SELECT car_id FROM dealership_leasings</span><span class='tstring_end'>&#39;</span></span>
157
+ <span class='rbracket'>]</span>
158
+
159
+ <span class='id identifier rubyid_sql'>sql</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SELECT ? IN (</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_parts'>parts</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> UNION </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>)</span><span class='tstring_end'>&#39;</span></span>
160
+
161
+ <span class='comment'># The &#39;san&#39; method takes n+1 arguments: The SQL string and n parameters
162
+ </span> <span class='id identifier rubyid_sanitized_sql'>sanitized_sql</span> <span class='op'>=</span> <span class='id identifier rubyid_san'>san</span><span class='lparen'>(</span><span class='id identifier rubyid_sql'>sql</span><span class='comma'>,</span> <span class='id identifier rubyid_osparams'>osparams</span><span class='period'>.</span><span class='id identifier rubyid_car_id'>car_id</span><span class='rparen'>)</span>
163
+
164
+ <span class='comment'># Returns instance of ActiveRecord::Result
165
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_exec_query'>exec_query</span><span class='lparen'>(</span><span class='id identifier rubyid_sanitized_sql'>sanitized_sql</span><span class='rparen'>)</span>
166
+ <span class='kw'>end</span>
167
+
168
+ <span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
169
+ <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_rows'>rows</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
170
+ <span class='kw'>end</span>
171
+ <span class='kw'>end</span>
172
+ </code></pre>
173
+
144
174
  <h2>Chainable queries</h2>
145
175
 
146
176
  <p>Chainable queries are queries that input and output an Active Record relation.
@@ -336,18 +366,17 @@ query classes.</li>
336
366
  <h2>Contributors</h2>
337
367
 
338
368
  <p>Thanks to Jeroen Weeink for his insights regarding using query classes as scopes
339
- in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog post</a>.
340
- And special thanks to <a href="http://www.subgit.com/">SubGit</a> for their great open source licensing.</p>
369
+ in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html">blog post</a>.</p>
341
370
 
342
371
  <h2>Copyright</h2>
343
372
 
344
- <p>Copyright (c) 2017 Sitrox. See <code>LICENSE</code> for further details.</p>
373
+ <p>Copyright (c) 2019 Sitrox. See <code>LICENSE</code> for further details.</p>
345
374
  </div></div>
346
375
 
347
376
  <div id="footer">
348
- Generated on Wed May 17 12:30:38 2017 by
377
+ Generated on Wed Oct 9 16:20:53 2019 by
349
378
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
350
- 0.9.9 (ruby-2.3.1).
379
+ 0.9.20 (ruby-2.6.2).
351
380
  </div>
352
381
 
353
382
  </div>
@@ -120,6 +120,49 @@ function summaryToggle() {
120
120
  } else { localStorage.summaryCollapsed = "expand"; }
121
121
  }
122
122
 
123
+ function constantSummaryToggle() {
124
+ $('.constants_summary_toggle').click(function(e) {
125
+ e.preventDefault();
126
+ localStorage.summaryCollapsed = $(this).text();
127
+ $('.constants_summary_toggle').each(function() {
128
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
129
+ var next = $(this).parent().parent().nextAll('dl.constants').first();
130
+ if (next.hasClass('compact')) {
131
+ next.toggle();
132
+ next.nextAll('dl.constants').first().toggle();
133
+ }
134
+ else if (next.hasClass('constants')) {
135
+ var list = $('<dl class="constants compact" />');
136
+ list.html(next.html());
137
+ list.find('dt').each(function() {
138
+ $(this).addClass('summary_signature');
139
+ $(this).text( $(this).text().split('=')[0]);
140
+ if ($(this).has(".deprecated").length) {
141
+ $(this).addClass('deprecated');
142
+ };
143
+ });
144
+ // Add the value of the constant as "Tooltip" to the summary object
145
+ list.find('pre.code').each(function() {
146
+ console.log($(this).parent());
147
+ var dt_element = $(this).parent().prev();
148
+ var tooltip = $(this).text();
149
+ if (dt_element.hasClass("deprecated")) {
150
+ tooltip = 'Deprecated. ' + tooltip;
151
+ };
152
+ dt_element.attr('title', tooltip);
153
+ });
154
+ list.find('.docstring, .tags, dd').remove();
155
+ next.before(list);
156
+ next.toggle();
157
+ }
158
+ });
159
+ return false;
160
+ });
161
+ if (localStorage.summaryCollapsed == "collapse") {
162
+ $('.constants_summary_toggle').first().click();
163
+ } else { localStorage.summaryCollapsed = "expand"; }
164
+ }
165
+
123
166
  function generateTOC() {
124
167
  if ($('#filecontents').length === 0) return;
125
168
  var _toc = $('<ol class="top"></ol>');
@@ -232,6 +275,16 @@ function mainFocus() {
232
275
  setTimeout(function() { $('#main').focus(); }, 10);
233
276
  }
234
277
 
278
+ function navigationChange() {
279
+ // This works around the broken anchor navigation with the YARD template.
280
+ window.onpopstate = function() {
281
+ var hash = window.location.hash;
282
+ if (hash !== '' && $(hash)[0]) {
283
+ $(hash)[0].scrollIntoView();
284
+ }
285
+ };
286
+ }
287
+
235
288
  $(document).ready(function() {
236
289
  navResizer();
237
290
  navExpander();
@@ -241,8 +294,10 @@ $(document).ready(function() {
241
294
  searchFrameButtons();
242
295
  linkSummaries();
243
296
  summaryToggle();
297
+ constantSummaryToggle();
244
298
  generateTOC();
245
299
  mainFocus();
300
+ navigationChange();
246
301
  });
247
302
 
248
303
  })();
@@ -46,8 +46,8 @@
46
46
 
47
47
  <li class="odd ">
48
48
  <div class="item">
49
- <span class='object_link'><a href="Inquery/Query.html#call-class_method" title="Inquery::Query.call (method)">call</a></span>
50
- <small>Inquery::Query</small>
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>
51
51
  </div>
52
52
  </li>
53
53
 
@@ -62,15 +62,15 @@
62
62
 
63
63
  <li class="odd ">
64
64
  <div class="item">
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>
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>
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-instance_method" title="Inquery::Query::Chainable#call (method)">#call</a></span>
73
+ <span class='object_link'><a href="Inquery/Query/Chainable.html#call-class_method" title="Inquery::Query::Chainable.call (method)">call</a></span>
74
74
  <small>Inquery::Query::Chainable</small>
75
75
  </div>
76
76
  </li>
@@ -78,13 +78,21 @@
78
78
 
79
79
  <li class="odd ">
80
80
  <div class="item">
81
- <span class='object_link'><a href="Inquery/Query.html#initialize-instance_method" title="Inquery::Query#initialize (method)">#initialize</a></span>
81
+ <span class='object_link'><a href="Inquery/Query.html#connection-instance_method" title="Inquery::Query#connection (method)">#connection</a></span>
82
82
  <small>Inquery::Query</small>
83
83
  </div>
84
84
  </li>
85
85
 
86
86
 
87
87
  <li class="even ">
88
+ <div class="item">
89
+ <span class='object_link'><a href="Inquery/Query/Chainable.html#connection-instance_method" title="Inquery::Query::Chainable#connection (method)">#connection</a></span>
90
+ <small>Inquery::Query::Chainable</small>
91
+ </div>
92
+ </li>
93
+
94
+
95
+ <li class="odd ">
88
96
  <div class="item">
89
97
  <span class='object_link'><a href="Inquery/Query/Chainable.html#initialize-instance_method" title="Inquery::Query::Chainable#initialize (method)">#initialize</a></span>
90
98
  <small>Inquery::Query::Chainable</small>
@@ -92,6 +100,14 @@
92
100
  </li>
93
101
 
94
102
 
103
+ <li class="even ">
104
+ <div class="item">
105
+ <span class='object_link'><a href="Inquery/Query.html#initialize-instance_method" title="Inquery::Query#initialize (method)">#initialize</a></span>
106
+ <small>Inquery::Query</small>
107
+ </div>
108
+ </li>
109
+
110
+
95
111
  <li class="odd ">
96
112
  <div class="item">
97
113
  <span class='object_link'><a href="Inquery/Query.html#osparams-instance_method" title="Inquery::Query#osparams (method)">#osparams</a></span>
@@ -134,7 +150,7 @@
134
150
 
135
151
  <li class="even ">
136
152
  <div class="item">
137
- <span class='object_link'><a href="Inquery/Query.html#run-class_method" title="Inquery::Query.run (method)">run</a></span>
153
+ <span class='object_link'><a href="Inquery/Query.html#run-instance_method" title="Inquery::Query#run (method)">#run</a></span>
138
154
  <small>Inquery::Query</small>
139
155
  </div>
140
156
  </li>
@@ -142,7 +158,7 @@
142
158
 
143
159
  <li class="odd ">
144
160
  <div class="item">
145
- <span class='object_link'><a href="Inquery/Query.html#run-instance_method" title="Inquery::Query#run (method)">#run</a></span>
161
+ <span class='object_link'><a href="Inquery/Query.html#run-class_method" title="Inquery::Query.run (method)">run</a></span>
146
162
  <small>Inquery::Query</small>
147
163
  </div>
148
164
  </li>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.9.9
9
+ &mdash; Documentation by YARD 0.9.20
10
10
 
11
11
  </title>
12
12
 
@@ -100,9 +100,9 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Wed May 17 12:30:38 2017 by
103
+ Generated on Wed Oct 9 16:20:53 2019 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
- 0.9.9 (ruby-2.3.1).
105
+ 0.9.20 (ruby-2.6.2).
106
106
  </div>
107
107
 
108
108
  </div>
@@ -1,16 +1,16 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: inquery 1.0.1 ruby lib
2
+ # stub: inquery 1.0.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "inquery".freeze
6
- s.version = "1.0.1"
6
+ s.version = "1.0.2"
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 = "2017-05-17"
12
- s.files = [".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, ".travis.yml".freeze, ".yardopts".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/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, "inquery.gemspec".freeze, "lib/inquery.rb".freeze, "lib/inquery/exceptions.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
- s.rubygems_version = "2.6.6".freeze
11
+ s.date = "2019-10-09"
12
+ s.files = [".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, ".travis.yml".freeze, ".yardopts".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, "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
+ s.rubygems_version = "3.0.3".freeze
14
14
  s.summary = "A skeleton that allows extracting queries into atomic, reusable classes.".freeze
15
15
  s.test_files = ["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]
16
16
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.specification_version = 4
19
19
 
20
20
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
21
- s.add_development_dependency(%q<bundler>.freeze, ["~> 1.3"])
21
+ s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
22
22
  s.add_development_dependency(%q<rake>.freeze, [">= 0"])
23
23
  s.add_development_dependency(%q<sqlite3>.freeze, [">= 0"])
24
24
  s.add_development_dependency(%q<haml>.freeze, [">= 0"])
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
30
30
  s.add_runtime_dependency(%q<activerecord>.freeze, [">= 0"])
31
31
  s.add_runtime_dependency(%q<schemacop>.freeze, ["~> 2.0"])
32
32
  else
33
- s.add_dependency(%q<bundler>.freeze, ["~> 1.3"])
33
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
34
34
  s.add_dependency(%q<rake>.freeze, [">= 0"])
35
35
  s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
36
36
  s.add_dependency(%q<haml>.freeze, [">= 0"])
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.add_dependency(%q<schemacop>.freeze, ["~> 2.0"])
44
44
  end
45
45
  else
46
- s.add_dependency(%q<bundler>.freeze, ["~> 1.3"])
46
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
47
47
  s.add_dependency(%q<rake>.freeze, [">= 0"])
48
48
  s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
49
49
  s.add_dependency(%q<haml>.freeze, [">= 0"])
@@ -6,5 +6,6 @@ require 'schemacop'
6
6
  require 'inquery/exceptions'
7
7
  require 'inquery/mixins/schema_validation'
8
8
  require 'inquery/mixins/relation_validation'
9
+ require 'inquery/mixins/raw_sql_utils'
9
10
  require 'inquery/query'
10
11
  require 'inquery/query/chainable'
@@ -0,0 +1,23 @@
1
+ module Inquery
2
+ module Mixins
3
+ module RawSqlUtils
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ # Sanitizes the SQL and substitutes in the supplied variables. Relies on
8
+ # `sanitize_sql_array` from ActiveRecord.
9
+ def san(sql, *variables)
10
+ ActiveRecord::Base.send(:sanitize_sql_array, [sql, *variables])
11
+ end
12
+
13
+ # Executes the sql on the connection provided by calling `connection`,
14
+ # which means that the method needs to be defined where this mixin is
15
+ # included. The sql passed in should be sanitized.
16
+ # Returns an instance of `ActiveRecord::Result`.
17
+ def exec_query(sql)
18
+ connection.exec_query(sql, self.class.to_s)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end