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 +4 -4
- data/lib/sqb/filtering.rb +5 -1
- data/lib/sqb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf773939419d3f07b0b56d017ba8d044bd366922cecf7ef3aaa3f0dfe2fa852
|
4
|
+
data.tar.gz: 3ee2271dadb659cf8b6fedf8e223da6e888284c431d99a8ee4d8f44f2a9cf4b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9149a4d5724ad99d3b892e21044b21629a55e05f1e6c6b1fef477bb4524ae5afe2244663cfe192c8f514dc3453449b1a898dddc37d1bc19dd63fa95a626b9866
|
7
|
+
data.tar.gz: 4e3b753a1209acaf5101da975d3f8a969b7a1621524f8b561d5308be7d528dd409b2459978e63af0c728f4bc5b9a0b11be722447d48573fb2ff6183d95f5abe7
|
data/lib/sqb/filtering.rb
CHANGED
@@ -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
|
-
|
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|
|
data/lib/sqb/version.rb
CHANGED