groovy 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/lib/groovy/query.rb +3 -1
- data/lib/groovy/version.rb +1 -1
- data/spec/query_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fe19dcb7e82fdd7b2406c612b32137d3db0ffb636f7b9b1f14933f79adf6e18
|
4
|
+
data.tar.gz: '038aee1d0a2a4c97fc29d7dd462bdf27dc372f62887191ec0d0852998c787c4f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ba1804fcda6767d13e38d7dc07c8ba81c7a865acc6a7ad153da24af9b7fec8f20737a753c61a2f3a642cc5a3e8874cbea8686b1071490fd42fe32f2fe719a0a
|
7
|
+
data.tar.gz: 0de80b8fdb6b8ef09c1c4083e2b821c209abe9e117f9ca65a7373a4c25556b1155e6f77b7e1e7a496cbc33bfd2d8c9df1e01a3a05851f76f3cdba376f187d3e3
|
data/lib/groovy/query.rb
CHANGED
@@ -203,7 +203,9 @@ module Groovy
|
|
203
203
|
# clear_query
|
204
204
|
raise "Duplicate param: #{param}"
|
205
205
|
end
|
206
|
-
|
206
|
+
|
207
|
+
# if param matches blank/nil, put at the end of the stack
|
208
|
+
param[/:\!?\\/] ? parameters.push(param) : parameters.unshift(param)
|
207
209
|
end
|
208
210
|
|
209
211
|
def results
|
data/lib/groovy/version.rb
CHANGED
data/spec/query_spec.rb
CHANGED
@@ -25,6 +25,10 @@ describe Groovy::Query do
|
|
25
25
|
it 'works with other args too' do
|
26
26
|
res = TestProduct.where(name: 'Product 5').where(tag_list: nil)
|
27
27
|
expect(res.map(&:id)).to eq([@p5.id])
|
28
|
+
|
29
|
+
# regardless of position
|
30
|
+
res = TestProduct.where(tag_list: nil).where(name: 'Product 5')
|
31
|
+
expect(res.map(&:id)).to eq([@p5.id])
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
@@ -111,6 +115,10 @@ describe Groovy::Query do
|
|
111
115
|
it 'works with other args too' do
|
112
116
|
res = TestProduct.where.not(name: 'Product 2').where.not(tag_list: nil)
|
113
117
|
expect(res.map(&:id)).to eq([@p1.id, @p4.id])
|
118
|
+
|
119
|
+
# regardless of position
|
120
|
+
res = TestProduct.where.not(tag_list: nil).where.not(name: 'Product 2')
|
121
|
+
expect(res.map(&:id)).to eq([@p1.id, @p4.id])
|
114
122
|
end
|
115
123
|
end
|
116
124
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groovy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomás Pollak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rroonga
|