sqb 1.0.5 → 1.0.6

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: 683f48c7299759f9bc62ba332ecd9ec8276c554172dc4ce367892d1f38b513f1
4
- data.tar.gz: 7a12b4b148c5a1fbedc8d7a2dd3d50b1d17e3bbd0e3bc154a3ea927a46422de1
3
+ metadata.gz: 3cf773939419d3f07b0b56d017ba8d044bd366922cecf7ef3aaa3f0dfe2fa852
4
+ data.tar.gz: 3ee2271dadb659cf8b6fedf8e223da6e888284c431d99a8ee4d8f44f2a9cf4b0
5
5
  SHA512:
6
- metadata.gz: 74a20d5314daa6d58f00d197d127e238ee9ccacbc2c4303619e624d4235e2a66672cf943b098f6333340e076ab89681b973051008118777daa116a7247461af4
7
- data.tar.gz: 4e761fe217c3511a5dc9ea9aa41430b10a1dc6872f712f15b3b30fd33df586431077734f8f90337ea901f54043b1d8b4c481d72e0dbc30f7bda02ce16d822344
6
+ metadata.gz: 9149a4d5724ad99d3b892e21044b21629a55e05f1e6c6b1fef477bb4524ae5afe2244663cfe192c8f514dc3453449b1a898dddc37d1bc19dd63fa95a626b9866
7
+ data.tar.gz: 4e3b753a1209acaf5101da975d3f8a969b7a1621524f8b561d5308be7d528dd409b2459978e63af0c728f4bc5b9a0b11be722447d48573fb2ff6183d95f5abe7
@@ -58,7 +58,11 @@ module SQB
58
58
 
59
59
  if value.is_a?(Array)
60
60
  escaped_values = value.map { |v| value_escape(v) }.join(', ')
61
- "#{key} IN (#{escaped_values})"
61
+ if escaped_values.empty?
62
+ "1=0"
63
+ else
64
+ "#{key} IN (#{escaped_values})"
65
+ end
62
66
  elsif value.is_a?(Hash)
63
67
  sql = []
64
68
  value.each do |operator, value|
@@ -1,3 +1,3 @@
1
1
  module SQB
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke