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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4cf906ae6b02c372764a0b38842986a3ac6b8db27207798c51db3e0708b838c
4
- data.tar.gz: 2104bb1cc0b8b22593cf856c63f0943e7cc7abc12609676af8c3394b677fcea0
3
+ metadata.gz: 6fe19dcb7e82fdd7b2406c612b32137d3db0ffb636f7b9b1f14933f79adf6e18
4
+ data.tar.gz: '038aee1d0a2a4c97fc29d7dd462bdf27dc372f62887191ec0d0852998c787c4f'
5
5
  SHA512:
6
- metadata.gz: 453c18aecd83f7615dbdaf71dbd29f1be7b807e510304b46c0b25095c64a4bcf53d6b1403488df19a49997792cac43dbc162cdad9a3e1754a1d17fda2a12a933
7
- data.tar.gz: 250930ca9234eed807582ae2292f0196168c3b76d7b9ca9797445e258539d661b6128795d99db40377ef7b49ca1c8af27d7ec7e62537ef0ce1d5ddba80b2d873
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
- parameters.push(param)
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
@@ -1,3 +1,3 @@
1
1
  module Groovy
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
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.0
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-14 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rroonga