inquery 1.0.7 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop.yml +17 -0
  3. data/.github/workflows/ruby.yml +53 -0
  4. data/.gitignore +2 -1
  5. data/.rubocop.yml +67 -2
  6. data/Appraisals +19 -0
  7. data/CHANGELOG.md +20 -0
  8. data/LICENSE +1 -1
  9. data/README.md +14 -2
  10. data/RUBY_VERSION +1 -1
  11. data/Rakefile +5 -5
  12. data/VERSION +1 -1
  13. data/doc/Inquery/Exceptions/Base.html +3 -3
  14. data/doc/Inquery/Exceptions/InvalidRelation.html +3 -3
  15. data/doc/Inquery/Exceptions/UnknownCallSignature.html +3 -3
  16. data/doc/Inquery/Exceptions.html +3 -3
  17. data/doc/Inquery/Mixins/RawSqlUtils.html +3 -3
  18. data/doc/Inquery/Mixins/RelationValidation/ClassMethods.html +3 -3
  19. data/doc/Inquery/Mixins/RelationValidation.html +8 -8
  20. data/doc/Inquery/Mixins/SchemaValidation/ClassMethods.html +3 -3
  21. data/doc/Inquery/Mixins/SchemaValidation.html +3 -3
  22. data/doc/Inquery/Mixins.html +3 -3
  23. data/doc/Inquery/Query/Chainable.html +3 -3
  24. data/doc/Inquery/Query.html +3 -3
  25. data/doc/Inquery.html +3 -3
  26. data/doc/_index.html +4 -4
  27. data/doc/css/style.css +1 -0
  28. data/doc/file.README.html +19 -5
  29. data/doc/frames.html +1 -1
  30. data/doc/index.html +19 -5
  31. data/doc/top-level-namespace.html +3 -3
  32. data/gemfiles/rails_5.1.gemfile +7 -0
  33. data/gemfiles/rails_5.2.gemfile +7 -0
  34. data/gemfiles/rails_6.0.gemfile +7 -0
  35. data/gemfiles/rails_6.1.gemfile +7 -0
  36. data/gemfiles/rails_7.0.gemfile +7 -0
  37. data/inquery.gemspec +21 -33
  38. data/lib/inquery/mixins/relation_validation.rb +6 -6
  39. data/lib/inquery.rb +1 -0
  40. data/test/test_helper.rb +1 -1
  41. metadata +18 -11
  42. data/.travis.yml +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c4ebd965ab27ba5e11502e0f6d90db2dadbeb8d6830c5f9e443cbd8f61a9597
4
- data.tar.gz: f2e84fbacddd9c57697209a9bed74007aefef67107760eeffba734ff5a55ecf9
3
+ metadata.gz: a42f9f4e3765f6e9026a13c7e623c4a51787589171c40e128375382c44f2cde0
4
+ data.tar.gz: 4bd9b28a6bc8a837e4efdf8845a13de1bf651382e4f609a855ba85a63bd65ad4
5
5
  SHA512:
6
- metadata.gz: e1d71dd15f4f0f7edcd259fa655add871903aa178c06005ac45d8ce472844040c8406f7fed2ec17fbcaf34668cba0308905a23748a47a1e686e3fe509c20d54b
7
- data.tar.gz: d034afc517e730bb1cb6e03cf0d4138ae31321afc06aac83801cf2ec266bf91b07efb9ced15f921fcf22cd375d7a1c15b5d9d9e5264f2c1ef4d8e074cabddd02
6
+ metadata.gz: 4ca5f8958bc74ebd0f2d67e7cc8a4dada0f981038ac486aa48da713988795390e99cf8ec49cb06df3aed5d18a7cec5c5923113c4a1e94da2184a4a027c5c4a20
7
+ data.tar.gz: dfcee1dcdb1eaf602d434b45977bf70da0cb0486377079ca0d4c72637abbc6319f9d90c97891f012a8cf67584ef8520ec350d1afbacdd998ad044b6fcb2b45c7
@@ -0,0 +1,17 @@
1
+ name: Rubocop check
2
+ on: push
3
+
4
+ jobs:
5
+ verify:
6
+ name: Test
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v1
11
+ - name: Set up Ruby
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 3.0.1
15
+ bundler-cache: true
16
+ - name: Run rubocop
17
+ run: bundle exec rubocop
@@ -0,0 +1,53 @@
1
+ name: Unit tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ include:
16
+ - rails-version: '5.1'
17
+ ruby-version: '2.5.1'
18
+ - rails-version: '5.2'
19
+ ruby-version: '2.5.1'
20
+ - rails-version: '5.2'
21
+ ruby-version: '2.6.2'
22
+ - rails-version: '6.0'
23
+ ruby-version: '2.5.1'
24
+ - rails-version: '6.0'
25
+ ruby-version: '2.6.2'
26
+ - rails-version: '6.0'
27
+ ruby-version: '2.7.1'
28
+ - rails-version: '6.1'
29
+ ruby-version: '2.5.1'
30
+ - rails-version: '6.1'
31
+ ruby-version: '2.6.2'
32
+ - rails-version: '6.1'
33
+ ruby-version: '2.7.1'
34
+ - rails-version: '6.1'
35
+ ruby-version: '3.0.1'
36
+ - rails-version: '7.0'
37
+ ruby-version: '2.7.1'
38
+ - rails-version: '7.0'
39
+ ruby-version: '3.0.1'
40
+ - rails-version: '7.0'
41
+ ruby-version: '3.1.0'
42
+ name: Test against Ruby ${{ matrix.ruby-version }} / Rails ${{ matrix.rails-version }}
43
+ env:
44
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile
45
+ steps:
46
+ - uses: actions/checkout@v2
47
+ - name: Set up Ruby ${{ matrix.ruby-version }}
48
+ uses: ruby/setup-ruby@v1
49
+ with:
50
+ ruby-version: ${{ matrix.ruby-version }}
51
+ bundler-cache: true
52
+ - name: Run rake tests
53
+ run: bundle exec rake test
data/.gitignore CHANGED
@@ -13,4 +13,5 @@ tmtags
13
13
  /spec/reports
14
14
  /.yardoc
15
15
  .idea
16
- /*.gem
16
+ /*.gem
17
+ /gemfiles/*.lock
data/.rubocop.yml CHANGED
@@ -1,15 +1,33 @@
1
1
  AllCops:
2
+ NewCops: enable
2
3
  Exclude:
3
4
  - 'local/**/*'
4
5
  - 'vendor/**/*'
5
6
  - 'tmp/**/*'
6
- - '*.gemspec'
7
+ - 'inquery.gemspec'
8
+ SuggestExtensions: false
7
9
 
8
10
  DisplayCopNames: true
9
11
 
12
+ Style/SignalException:
13
+ EnforcedStyle: only_fail
14
+
10
15
  Metrics/MethodLength:
11
16
  Enabled: false
12
17
 
18
+ Metrics/ClassLength:
19
+ Enabled: false
20
+
21
+ Metrics/ModuleLength:
22
+ Enabled: false
23
+
24
+ Metrics/BlockLength:
25
+ Enabled: false
26
+
27
+ Metrics/ParameterLists:
28
+ Max: 5
29
+ CountKeywordArgs: false
30
+
13
31
  Metrics/AbcSize:
14
32
  Enabled: False
15
33
 
@@ -19,9 +37,12 @@ Metrics/CyclomaticComplexity:
19
37
  Metrics/PerceivedComplexity:
20
38
  Enabled: False
21
39
 
22
- Metrics/LineLength:
40
+ Layout/LineLength:
23
41
  Max: 160
24
42
 
43
+ Metrics/BlockNesting:
44
+ Enabled: false
45
+
25
46
  Style/IfUnlessModifier:
26
47
  Enabled: false
27
48
 
@@ -31,6 +52,9 @@ Style/Documentation:
31
52
  Style/RedundantReturn:
32
53
  Enabled: false
33
54
 
55
+ Style/AsciiComments:
56
+ Enabled: false
57
+
34
58
  Style/GuardClause:
35
59
  Enabled: false
36
60
 
@@ -40,3 +64,44 @@ Style/ClassAndModuleChildren:
40
64
  SupportedStyles:
41
65
  - nested
42
66
  - compact
67
+ # Checks the style of children definitions at classes and modules.
68
+ #
69
+ # Basically there are two different styles:
70
+ #
71
+ # `nested` - have each child on a separate line
72
+ # class Foo
73
+ # class Bar
74
+ # end
75
+ # end
76
+ #
77
+ # `compact` - combine definitions as much as possible
78
+ # class Foo::Bar
79
+ # end
80
+ #
81
+ # The compact style is only forced, for classes / modules with one child.
82
+
83
+ Style/FormatString:
84
+ Enabled: false
85
+
86
+ # Multiline hashes should be aligned cleanly as a table to improve readability.
87
+ Layout/HashAlignment:
88
+ EnforcedHashRocketStyle: table
89
+ EnforcedColonStyle: table
90
+
91
+ Style/FrozenStringLiteralComment:
92
+ Enabled: false
93
+
94
+ Style/AccessorGrouping:
95
+ Enabled: false
96
+
97
+ Style/DoubleNegation:
98
+ Enabled: false
99
+
100
+ Style/ConditionalAssignment:
101
+ Enabled: false
102
+
103
+ Style/CaseLikeIf:
104
+ Enabled: false
105
+
106
+ Style/OpenStructUse:
107
+ Enabled: false
data/Appraisals ADDED
@@ -0,0 +1,19 @@
1
+ appraise 'rails-7.0' do
2
+ gem 'rails', '~> 7.0.1'
3
+ end
4
+
5
+ appraise 'rails-6.1' do
6
+ gem 'rails', '~> 6.1.4'
7
+ end
8
+
9
+ appraise 'rails-6.0' do
10
+ gem 'rails', '~> 6.0.4'
11
+ end
12
+
13
+ appraise 'rails-5.2' do
14
+ gem 'rails', '~> 5.2.6'
15
+ end
16
+
17
+ appraise 'rails-5.1' do
18
+ gem 'rails', '~> 5.1.7'
19
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change log
2
2
 
3
+ ## 1.0.10 (2022-05-19)
4
+
5
+ * Update gem-internal ruby version and remove `bundler` from gemspec
6
+
7
+ ## 1.0.9 (2021-02-24)
8
+
9
+ - Update `schemacop` to version `~> 3.0.8`
10
+
11
+ - Add the following ruby versions to travis testing:
12
+ - `2.5.1`
13
+ - `2.6.2`
14
+ - `2.7.1`
15
+ - `3.0.0`
16
+
17
+ - Remove ruby `2.3.0` from travis testing
18
+
19
+ ## 1.0.8 (2020-11-24)
20
+
21
+ - Improve support for schemacop 3.x
22
+
3
23
  ## 1.0.7 (2020-11-24)
4
24
 
5
25
  - Improve support for schemacop 3.x
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 Sitrox
3
+ Copyright © 2016 - 2022 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
@@ -1,4 +1,5 @@
1
- [![Build Status](https://travis-ci.org/sitrox/inquery.svg?branch=master)](https://travis-ci.org/sitrox/inquery)
1
+ [![Unit tests](https://github.com/sitrox/inquery/actions/workflows/ruby.yml/badge.svg)](https://github.com/sitrox/inquery/actions/workflows/ruby.yml)
2
+ [![Rubocop check](https://github.com/sitrox/inquery/actions/workflows/rubocop.yml/badge.svg)](https://github.com/sitrox/inquery/actions/workflows/rubocop.yml)
2
3
  [![Gem Version](https://badge.fury.io/rb/inquery.svg)](https://badge.fury.io/rb/inquery)
3
4
 
4
5
  # Inquery
@@ -20,6 +21,17 @@ to your `Gemfile`:
20
21
  gem 'inquery'
21
22
  ```
22
23
 
24
+ ## Compatibility
25
+
26
+ Inquery is tested with the following ruby versions:
27
+
28
+ * 2.5.1
29
+ * 2.6.2
30
+ * 2.7.1
31
+ * 3.0.1
32
+
33
+ Other ruby versions might work but are not covered by our automated tests.
34
+
23
35
  ## Basic usage
24
36
 
25
37
  ```ruby
@@ -325,4 +337,4 @@ in his [blog post](http://craftingruby.com/posts/2015/06/29/query-objects-throug
325
337
 
326
338
  ## Copyright
327
339
 
328
- Copyright (c) 2020 Sitrox. See `LICENSE` for further details.
340
+ Copyright © 2016 - 2022 Sitrox. See `LICENSE` for further details.
data/RUBY_VERSION CHANGED
@@ -1 +1 @@
1
- ruby-2.6.2-p47
1
+ ruby-3.0.1-p64
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  task :gemspec do
2
2
  gemspec = Gem::Specification.new do |spec|
3
3
  spec.name = 'inquery'
4
- spec.version = IO.read('VERSION').chomp
4
+ spec.version = File.read('VERSION').chomp
5
5
  spec.authors = ['Sitrox']
6
6
  spec.summary = %(
7
7
  A skeleton that allows extracting queries into atomic, reusable classes.
@@ -11,20 +11,20 @@ task :gemspec do
11
11
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
12
12
  spec.require_paths = ['lib']
13
13
 
14
- spec.add_development_dependency 'bundler'
14
+ spec.add_development_dependency 'appraisal'
15
15
  spec.add_development_dependency 'rake'
16
16
  spec.add_development_dependency 'sqlite3'
17
17
  spec.add_development_dependency 'haml'
18
18
  spec.add_development_dependency 'yard'
19
- spec.add_development_dependency 'rubocop', '0.35.1'
19
+ spec.add_development_dependency 'rubocop', '1.25'
20
20
  spec.add_development_dependency 'redcarpet'
21
21
  spec.add_dependency 'minitest'
22
22
  spec.add_dependency 'activesupport'
23
23
  spec.add_dependency 'activerecord'
24
- spec.add_dependency 'schemacop', '>= 2.0'
24
+ spec.add_dependency 'schemacop', '~> 3.0.8'
25
25
  end
26
26
 
27
- File.open('inquery.gemspec', 'w') { |f| f.write(gemspec.to_ruby.strip) }
27
+ File.write('inquery.gemspec', gemspec.to_ruby.strip)
28
28
  end
29
29
 
30
30
  require 'rake/testtask'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.7
1
+ 1.0.10
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Inquery::Exceptions::Base
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -118,9 +118,9 @@
118
118
  </div>
119
119
 
120
120
  <div id="footer">
121
- Generated on Wed Nov 25 14:05:20 2020 by
121
+ Generated on Thu May 19 10:36:15 2022 by
122
122
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
- 0.9.25 (ruby-2.6.2).
123
+ 0.9.27 (ruby-3.0.1).
124
124
  </div>
125
125
 
126
126
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Inquery::Exceptions::InvalidRelation
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -122,9 +122,9 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Wed Nov 25 14:05:20 2020 by
125
+ Generated on Thu May 19 10:36:15 2022 by
126
126
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
- 0.9.25 (ruby-2.6.2).
127
+ 0.9.27 (ruby-3.0.1).
128
128
  </div>
129
129
 
130
130
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Inquery::Exceptions::UnknownCallSignature
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -122,9 +122,9 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Wed Nov 25 14:05:20 2020 by
125
+ Generated on Thu May 19 10:36:15 2022 by
126
126
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
- 0.9.25 (ruby-2.6.2).
127
+ 0.9.27 (ruby-3.0.1).
128
128
  </div>
129
129
 
130
130
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Exceptions
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -105,9 +105,9 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Wed Nov 25 14:05:20 2020 by
108
+ Generated on Thu May 19 10:36:15 2022 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
- 0.9.25 (ruby-2.6.2).
110
+ 0.9.27 (ruby-3.0.1).
111
111
  </div>
112
112
 
113
113
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::RawSqlUtils
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -106,9 +106,9 @@
106
106
  </div>
107
107
 
108
108
  <div id="footer">
109
- Generated on Wed Nov 25 14:05:20 2020 by
109
+ Generated on Thu May 19 10:36:15 2022 by
110
110
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
111
- 0.9.25 (ruby-2.6.2).
111
+ 0.9.27 (ruby-3.0.1).
112
112
  </div>
113
113
 
114
114
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::RelationValidation::ClassMethods
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -178,9 +178,9 @@ 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 Wed Nov 25 14:05:20 2020 by
181
+ Generated on Thu May 19 10:36:15 2022 by
182
182
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
183
- 0.9.25 (ruby-2.6.2).
183
+ 0.9.27 (ruby-3.0.1).
184
184
  </div>
185
185
 
186
186
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::RelationValidation
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -130,26 +130,26 @@
130
130
  </span> <span class='comment'># `nil` to not perform any checks. The `class` attribute will also be
131
131
  </span> <span class='comment'># taken to infer a default if no relation is given and you didn&#39;t
132
132
  </span> <span class='comment'># specify any `default`.
133
- </span> <span class='label'>class:</span> <span class='kw'>nil</span><span class='comma'>,</span>
133
+ </span> <span class='label'>class:</span> <span class='kw'>nil</span><span class='comma'>,</span>
134
134
 
135
135
  <span class='comment'># This allows to specify a default relation that will be taken if no
136
136
  </span> <span class='comment'># relation is given. This must be specified as a Proc returning the
137
137
  </span> <span class='comment'># relation. Set this to `false` for no default. If this is set to `nil`,
138
138
  </span> <span class='comment'># it will try to infer the default from the option `class` (if given).
139
- </span> <span class='label'>default:</span> <span class='kw'>nil</span><span class='comma'>,</span>
139
+ </span> <span class='label'>default:</span> <span class='kw'>nil</span><span class='comma'>,</span>
140
140
 
141
141
  <span class='comment'># Allows to restrict the number of fields / values the relation must
142
142
  </span> <span class='comment'># select. This is particularly useful if you&#39;re using the query as a
143
143
  </span> <span class='comment'># subquery and need it to return exactly one field. Use `nil` to not
144
144
  </span> <span class='comment'># perform any checks.
145
- </span> <span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span>
145
+ </span> <span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span>
146
146
 
147
147
  <span class='comment'># If this is set to a symbol, the relation does not have any select
148
148
  </span> <span class='comment'># fields specified (`select_values` is empty) and `fields` is &gt; 0, it
149
149
  </span> <span class='comment'># will automatically select the given field. Use `nil` to disable this
150
150
  </span> <span class='comment'># behavior.
151
151
  </span> <span class='label'>default_select:</span> <span class='symbol'>:id</span>
152
- <span class='rbrace'>}</span></pre></dd>
152
+ <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
153
153
 
154
154
  </dl>
155
155
 
@@ -304,7 +304,7 @@ options specified at class level using the <code>relation</code> method.</p>
304
304
  </span> <span class='comment'># ---------------------------------------------------------------
305
305
  </span> <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>=</span> <span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_select_values'>select_values</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
306
306
 
307
- <span class='kw'>if</span> <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>==</span> <span class='int'>0</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='int'>0</span>
307
+ <span class='kw'>if</span> <span class='id identifier rubyid_fields_count'>fields_count</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
308
308
  <span class='id identifier rubyid_relation'>relation</span> <span class='op'>=</span> <span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span><span class='rparen'>)</span>
309
309
  <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>=</span> <span class='int'>1</span>
310
310
  <span class='kw'>end</span>
@@ -325,9 +325,9 @@ 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 Wed Nov 25 14:05:20 2020 by
328
+ Generated on Thu May 19 10:36:15 2022 by
329
329
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
330
- 0.9.25 (ruby-2.6.2).
330
+ 0.9.27 (ruby-3.0.1).
331
331
  </div>
332
332
 
333
333
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::SchemaValidation::ClassMethods
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -292,9 +292,9 @@
292
292
  </div>
293
293
 
294
294
  <div id="footer">
295
- Generated on Wed Nov 25 14:05:20 2020 by
295
+ Generated on Thu May 19 10:36:15 2022 by
296
296
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
297
- 0.9.25 (ruby-2.6.2).
297
+ 0.9.27 (ruby-3.0.1).
298
298
  </div>
299
299
 
300
300
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::SchemaValidation
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -116,9 +116,9 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Wed Nov 25 14:05:20 2020 by
119
+ Generated on Thu May 19 10:36:15 2022 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
- 0.9.25 (ruby-2.6.2).
121
+ 0.9.27 (ruby-3.0.1).
122
122
  </div>
123
123
 
124
124
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -107,9 +107,9 @@
107
107
  </div>
108
108
 
109
109
  <div id="footer">
110
- Generated on Wed Nov 25 14:05:20 2020 by
110
+ Generated on Thu May 19 10:36:15 2022 by
111
111
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
- 0.9.25 (ruby-2.6.2).
112
+ 0.9.27 (ruby-3.0.1).
113
113
  </div>
114
114
 
115
115
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Inquery::Query::Chainable
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -529,9 +529,9 @@
529
529
  </div>
530
530
 
531
531
  <div id="footer">
532
- Generated on Wed Nov 25 14:05:20 2020 by
532
+ Generated on Thu May 19 10:36:15 2022 by
533
533
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
534
- 0.9.25 (ruby-2.6.2).
534
+ 0.9.27 (ruby-3.0.1).
535
535
  </div>
536
536
 
537
537
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Inquery::Query
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -779,9 +779,9 @@ easyer access.</p>
779
779
  </div>
780
780
 
781
781
  <div id="footer">
782
- Generated on Wed Nov 25 14:05:20 2020 by
782
+ Generated on Thu May 19 10:36:15 2022 by
783
783
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
784
- 0.9.25 (ruby-2.6.2).
784
+ 0.9.27 (ruby-3.0.1).
785
785
  </div>
786
786
 
787
787
  </div>
data/doc/Inquery.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -109,9 +109,9 @@
109
109
  </div>
110
110
 
111
111
  <div id="footer">
112
- Generated on Wed Nov 25 14:05:20 2020 by
112
+ Generated on Thu May 19 10:36:15 2022 by
113
113
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
114
- 0.9.25 (ruby-2.6.2).
114
+ 0.9.27 (ruby-3.0.1).
115
115
  </div>
116
116
 
117
117
  </div>
data/doc/_index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
- Documentation by YARD 0.9.25
7
+ Documentation by YARD 0.9.27
8
8
 
9
9
  </title>
10
10
 
@@ -52,7 +52,7 @@
52
52
  <div class="clear"></div>
53
53
  </div>
54
54
 
55
- <div id="content"><h1 class="noborder title">Documentation by YARD 0.9.25</h1>
55
+ <div id="content"><h1 class="noborder title">Documentation by YARD 0.9.27</h1>
56
56
  <div id="listing">
57
57
  <h1 class="alphaindex">Alphabetic Index</h1>
58
58
 
@@ -248,9 +248,9 @@
248
248
  </div>
249
249
 
250
250
  <div id="footer">
251
- Generated on Wed Nov 25 14:05:19 2020 by
251
+ Generated on Thu May 19 10:36:15 2022 by
252
252
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
253
- 0.9.25 (ruby-2.6.2).
253
+ 0.9.27 (ruby-3.0.1).
254
254
  </div>
255
255
 
256
256
  </div>
data/doc/css/style.css CHANGED
@@ -52,6 +52,7 @@ body {
52
52
  background: #fff;
53
53
  padding: 1.2em;
54
54
  padding-top: 0.2em;
55
+ box-sizing: border-box;
55
56
  }
56
57
 
57
58
  @media (max-width: 920px) {
data/doc/file.README.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -57,7 +57,8 @@
57
57
  <div class="clear"></div>
58
58
  </div>
59
59
 
60
- <div id="content"><div id='filecontents'><p><a href="https://travis-ci.org/sitrox/inquery"><img src="https://travis-ci.org/sitrox/inquery.svg?branch=master" alt="Build Status"></a>
60
+ <div id="content"><div id='filecontents'><p><a href="https://github.com/sitrox/inquery/actions/workflows/ruby.yml"><img src="https://github.com/sitrox/inquery/actions/workflows/ruby.yml/badge.svg" alt="Unit tests"></a>
61
+ <a href="https://github.com/sitrox/inquery/actions/workflows/rubocop.yml"><img src="https://github.com/sitrox/inquery/actions/workflows/rubocop.yml/badge.svg" alt="Rubocop check"></a>
61
62
  <a href="https://badge.fury.io/rb/inquery"><img src="https://badge.fury.io/rb/inquery.svg" alt="Gem Version"></a></p>
62
63
 
63
64
  <h1 id="inquery">Inquery</h1>
@@ -77,6 +78,19 @@ to your <code>Gemfile</code>:</p>
77
78
  <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>inquery</span><span class='tstring_end'>&#39;</span></span>
78
79
  </code></pre>
79
80
 
81
+ <h2 id="compatibility">Compatibility</h2>
82
+
83
+ <p>Inquery is tested with the following ruby versions:</p>
84
+
85
+ <ul>
86
+ <li>2.5.1</li>
87
+ <li>2.6.2</li>
88
+ <li>2.7.1</li>
89
+ <li>3.0.1</li>
90
+ </ul>
91
+
92
+ <p>Other ruby versions might work but are not covered by our automated tests.</p>
93
+
80
94
  <h2 id="basic-usage">Basic usage</h2>
81
95
 
82
96
  <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>FetchUsersWithACar</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>
@@ -373,13 +387,13 @@ in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-s
373
387
 
374
388
  <h2 id="copyright">Copyright</h2>
375
389
 
376
- <p>Copyright (c) 2020 Sitrox. See <code>LICENSE</code> for further details.</p>
390
+ <p>Copyright © 2016 - 2022 Sitrox. See <code>LICENSE</code> for further details.</p>
377
391
  </div></div>
378
392
 
379
393
  <div id="footer">
380
- Generated on Wed Nov 25 14:05:20 2020 by
394
+ Generated on Thu May 19 10:36:15 2022 by
381
395
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
382
- 0.9.25 (ruby-2.6.2).
396
+ 0.9.27 (ruby-3.0.1).
383
397
  </div>
384
398
 
385
399
  </div>
data/doc/frames.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Documentation by YARD 0.9.25</title>
5
+ <title>Documentation by YARD 0.9.27</title>
6
6
  </head>
7
7
  <script type="text/javascript">
8
8
  var match = unescape(window.location.hash).match(/^#!(.+)/);
data/doc/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -57,7 +57,8 @@
57
57
  <div class="clear"></div>
58
58
  </div>
59
59
 
60
- <div id="content"><div id='filecontents'><p><a href="https://travis-ci.org/sitrox/inquery"><img src="https://travis-ci.org/sitrox/inquery.svg?branch=master" alt="Build Status"></a>
60
+ <div id="content"><div id='filecontents'><p><a href="https://github.com/sitrox/inquery/actions/workflows/ruby.yml"><img src="https://github.com/sitrox/inquery/actions/workflows/ruby.yml/badge.svg" alt="Unit tests"></a>
61
+ <a href="https://github.com/sitrox/inquery/actions/workflows/rubocop.yml"><img src="https://github.com/sitrox/inquery/actions/workflows/rubocop.yml/badge.svg" alt="Rubocop check"></a>
61
62
  <a href="https://badge.fury.io/rb/inquery"><img src="https://badge.fury.io/rb/inquery.svg" alt="Gem Version"></a></p>
62
63
 
63
64
  <h1 id="inquery">Inquery</h1>
@@ -77,6 +78,19 @@ to your <code>Gemfile</code>:</p>
77
78
  <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>inquery</span><span class='tstring_end'>&#39;</span></span>
78
79
  </code></pre>
79
80
 
81
+ <h2 id="compatibility">Compatibility</h2>
82
+
83
+ <p>Inquery is tested with the following ruby versions:</p>
84
+
85
+ <ul>
86
+ <li>2.5.1</li>
87
+ <li>2.6.2</li>
88
+ <li>2.7.1</li>
89
+ <li>3.0.1</li>
90
+ </ul>
91
+
92
+ <p>Other ruby versions might work but are not covered by our automated tests.</p>
93
+
80
94
  <h2 id="basic-usage">Basic usage</h2>
81
95
 
82
96
  <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>FetchUsersWithACar</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>
@@ -373,13 +387,13 @@ in his <a href="http://craftingruby.com/posts/2015/06/29/query-objects-through-s
373
387
 
374
388
  <h2 id="copyright">Copyright</h2>
375
389
 
376
- <p>Copyright (c) 2020 Sitrox. See <code>LICENSE</code> for further details.</p>
390
+ <p>Copyright © 2016 - 2022 Sitrox. See <code>LICENSE</code> for further details.</p>
377
391
  </div></div>
378
392
 
379
393
  <div id="footer">
380
- Generated on Wed Nov 25 14:05:19 2020 by
394
+ Generated on Thu May 19 10:36:15 2022 by
381
395
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
382
- 0.9.25 (ruby-2.6.2).
396
+ 0.9.27 (ruby-3.0.1).
383
397
  </div>
384
398
 
385
399
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.27
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 Nov 25 14:05:20 2020 by
103
+ Generated on Thu May 19 10:36:15 2022 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
- 0.9.25 (ruby-2.6.2).
105
+ 0.9.27 (ruby-3.0.1).
106
106
  </div>
107
107
 
108
108
  </div>
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'rails', '~> 5.1.7'
6
+
7
+ gemspec path: '../'
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'rails', '~> 5.2.6'
6
+
7
+ gemspec path: '../'
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'rails', '~> 6.0.4'
6
+
7
+ gemspec path: '../'
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'rails', '~> 6.1.4'
6
+
7
+ gemspec path: '../'
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'rails', '~> 7.0.1'
6
+
7
+ gemspec path: '../'
data/inquery.gemspec CHANGED
@@ -1,58 +1,46 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: inquery 1.0.7 ruby lib
2
+ # stub: inquery 1.0.10 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "inquery".freeze
6
- s.version = "1.0.7"
6
+ s.version = "1.0.10"
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 = "2020-11-25"
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
11
+ s.date = "2022-05-19"
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
+ s.rubygems_version = "3.2.16".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
 
17
17
  if s.respond_to? :specification_version then
18
18
  s.specification_version = 4
19
+ end
19
20
 
20
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
21
- s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
22
- s.add_development_dependency(%q<rake>.freeze, [">= 0"])
23
- s.add_development_dependency(%q<sqlite3>.freeze, [">= 0"])
24
- s.add_development_dependency(%q<haml>.freeze, [">= 0"])
25
- s.add_development_dependency(%q<yard>.freeze, [">= 0"])
26
- s.add_development_dependency(%q<rubocop>.freeze, ["= 0.35.1"])
27
- s.add_development_dependency(%q<redcarpet>.freeze, [">= 0"])
28
- s.add_runtime_dependency(%q<minitest>.freeze, [">= 0"])
29
- s.add_runtime_dependency(%q<activesupport>.freeze, [">= 0"])
30
- s.add_runtime_dependency(%q<activerecord>.freeze, [">= 0"])
31
- s.add_runtime_dependency(%q<schemacop>.freeze, [">= 2.0"])
32
- else
33
- s.add_dependency(%q<bundler>.freeze, [">= 0"])
34
- s.add_dependency(%q<rake>.freeze, [">= 0"])
35
- s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
36
- s.add_dependency(%q<haml>.freeze, [">= 0"])
37
- s.add_dependency(%q<yard>.freeze, [">= 0"])
38
- s.add_dependency(%q<rubocop>.freeze, ["= 0.35.1"])
39
- s.add_dependency(%q<redcarpet>.freeze, [">= 0"])
40
- s.add_dependency(%q<minitest>.freeze, [">= 0"])
41
- s.add_dependency(%q<activesupport>.freeze, [">= 0"])
42
- s.add_dependency(%q<activerecord>.freeze, [">= 0"])
43
- s.add_dependency(%q<schemacop>.freeze, [">= 2.0"])
44
- end
21
+ if s.respond_to? :add_runtime_dependency then
22
+ s.add_development_dependency(%q<appraisal>.freeze, [">= 0"])
23
+ s.add_development_dependency(%q<rake>.freeze, [">= 0"])
24
+ s.add_development_dependency(%q<sqlite3>.freeze, [">= 0"])
25
+ s.add_development_dependency(%q<haml>.freeze, [">= 0"])
26
+ s.add_development_dependency(%q<yard>.freeze, [">= 0"])
27
+ s.add_development_dependency(%q<rubocop>.freeze, ["= 1.25"])
28
+ s.add_development_dependency(%q<redcarpet>.freeze, [">= 0"])
29
+ s.add_runtime_dependency(%q<minitest>.freeze, [">= 0"])
30
+ s.add_runtime_dependency(%q<activesupport>.freeze, [">= 0"])
31
+ s.add_runtime_dependency(%q<activerecord>.freeze, [">= 0"])
32
+ s.add_runtime_dependency(%q<schemacop>.freeze, ["~> 3.0.8"])
45
33
  else
46
- s.add_dependency(%q<bundler>.freeze, [">= 0"])
34
+ s.add_dependency(%q<appraisal>.freeze, [">= 0"])
47
35
  s.add_dependency(%q<rake>.freeze, [">= 0"])
48
36
  s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
49
37
  s.add_dependency(%q<haml>.freeze, [">= 0"])
50
38
  s.add_dependency(%q<yard>.freeze, [">= 0"])
51
- s.add_dependency(%q<rubocop>.freeze, ["= 0.35.1"])
39
+ s.add_dependency(%q<rubocop>.freeze, ["= 1.25"])
52
40
  s.add_dependency(%q<redcarpet>.freeze, [">= 0"])
53
41
  s.add_dependency(%q<minitest>.freeze, [">= 0"])
54
42
  s.add_dependency(%q<activesupport>.freeze, [">= 0"])
55
43
  s.add_dependency(%q<activerecord>.freeze, [">= 0"])
56
- s.add_dependency(%q<schemacop>.freeze, [">= 2.0"])
44
+ s.add_dependency(%q<schemacop>.freeze, ["~> 3.0.8"])
57
45
  end
58
46
  end
@@ -8,7 +8,7 @@ module Inquery
8
8
  str? :class
9
9
  int? :fields
10
10
  sym? :default_select
11
- rby? :default, [Proc, FalseClass]
11
+ obj? :default, classes: [Proc, FalseClass]
12
12
  end
13
13
  else
14
14
  OPTIONS_SCHEMA = Schemacop::Schema.new do
@@ -24,26 +24,26 @@ module Inquery
24
24
  # `nil` to not perform any checks. The `class` attribute will also be
25
25
  # taken to infer a default if no relation is given and you didn't
26
26
  # specify any `default`.
27
- class: nil,
27
+ class: nil,
28
28
 
29
29
  # This allows to specify a default relation that will be taken if no
30
30
  # relation is given. This must be specified as a Proc returning the
31
31
  # relation. Set this to `false` for no default. If this is set to `nil`,
32
32
  # it will try to infer the default from the option `class` (if given).
33
- default: nil,
33
+ default: nil,
34
34
 
35
35
  # Allows to restrict the number of fields / values the relation must
36
36
  # select. This is particularly useful if you're using the query as a
37
37
  # subquery and need it to return exactly one field. Use `nil` to not
38
38
  # perform any checks.
39
- fields: nil,
39
+ fields: nil,
40
40
 
41
41
  # If this is set to a symbol, the relation does not have any select
42
42
  # fields specified (`select_values` is empty) and `fields` is > 0, it
43
43
  # will automatically select the given field. Use `nil` to disable this
44
44
  # behavior.
45
45
  default_select: :id
46
- }
46
+ }.freeze
47
47
 
48
48
  included do
49
49
  class_attribute :_relation_options
@@ -91,7 +91,7 @@ module Inquery
91
91
  # ---------------------------------------------------------------
92
92
  fields_count = relation.select_values.size
93
93
 
94
- if fields_count == 0 && options[:default_select] && options[:fields] && options[:fields] > 0
94
+ if fields_count.zero? && options[:default_select] && options[:fields] && (options[:fields]).positive?
95
95
  relation = relation.select(options[:default_select])
96
96
  fields_count = 1
97
97
  end
data/lib/inquery.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Inquery
2
2
  end
3
3
 
4
+ require 'uri'
4
5
  require 'schemacop'
5
6
 
6
7
  require 'inquery/exceptions'
data/test/test_helper.rb CHANGED
@@ -10,7 +10,7 @@ module TestHelper
10
10
 
11
11
  module ClassMethods
12
12
  def setup_db
13
- load File.dirname(__FILE__) + '/db/schema.rb'
13
+ load "#{File.dirname(__FILE__)}/db/schema.rb"
14
14
  end
15
15
 
16
16
  def setup_base_data
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: appraisal
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.35.1
89
+ version: '1.25'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.35.1
96
+ version: '1.25'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: redcarpet
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -154,27 +154,29 @@ dependencies:
154
154
  name: schemacop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '2.0'
159
+ version: 3.0.8
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '2.0'
166
+ version: 3.0.8
167
167
  description:
168
168
  email:
169
169
  executables: []
170
170
  extensions: []
171
171
  extra_rdoc_files: []
172
172
  files:
173
+ - ".github/workflows/rubocop.yml"
174
+ - ".github/workflows/ruby.yml"
173
175
  - ".gitignore"
174
176
  - ".releaser_config"
175
177
  - ".rubocop.yml"
176
- - ".travis.yml"
177
178
  - ".yardopts"
179
+ - Appraisals
178
180
  - CHANGELOG.md
179
181
  - Gemfile
180
182
  - LICENSE
@@ -209,6 +211,11 @@ files:
209
211
  - doc/js/jquery.js
210
212
  - doc/method_list.html
211
213
  - doc/top-level-namespace.html
214
+ - gemfiles/rails_5.1.gemfile
215
+ - gemfiles/rails_5.2.gemfile
216
+ - gemfiles/rails_6.0.gemfile
217
+ - gemfiles/rails_6.1.gemfile
218
+ - gemfiles/rails_7.0.gemfile
212
219
  - inquery.gemspec
213
220
  - lib/inquery.rb
214
221
  - lib/inquery/exceptions.rb
@@ -247,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
254
  - !ruby/object:Gem::Version
248
255
  version: '0'
249
256
  requirements: []
250
- rubygems_version: 3.1.4
257
+ rubygems_version: 3.3.11
251
258
  signing_key:
252
259
  specification_version: 4
253
260
  summary: A skeleton that allows extracting queries into atomic, reusable classes.
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.0
4
- script:
5
- - bundle install
6
- - bundle exec rake test
7
- - bundle exec rubocop