procore-sift 1.2.0 → 1.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/sift/filtrator.rb +13 -1
- data/lib/sift/version.rb +1 -1
- 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: 2f9709a71e8b6a3806481a7f7a5289da46ab0deddb66da0925eef0cfe511ed05
|
|
4
|
+
data.tar.gz: 05635c8f1d8498e074c5d9786eec48b699dcbd36cedd0bc181c1839f1871138c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16a6fe87884245e280d4fbef123136add0ec15bf2092439217fd39f5eb8c70f49498f89129f83ca82da40d459f2267fb71dbffec8355d3da99a17402a806a14e
|
|
7
|
+
data.tar.gz: 1ea9393b9b164417d965221b3bb96540bfd1c4bfd6ff407a6c80ec1af1a826b3bc0ec0c93d6ff9ec2287578e6a76c82026d14706d143d09b72d894910efe4c97
|
data/lib/sift/filtrator.rb
CHANGED
|
@@ -46,8 +46,20 @@ module Sift
|
|
|
46
46
|
|
|
47
47
|
def active_filters
|
|
48
48
|
filters.select do |filter|
|
|
49
|
-
|
|
49
|
+
active_filter_param?(filter) || filter.default || filter.always_active?
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
|
+
|
|
53
|
+
# A filter is active when its param is present AND carries a meaningful value.
|
|
54
|
+
# A literal `false` is meaningful (a boolean filter value — see #58), but a
|
|
55
|
+
# blank value (nil / "" / []) leaves the filter inactive, matching pre-1.2
|
|
56
|
+
# behavior. Prior to this, any present key activated the filter, so an empty
|
|
57
|
+
# value produced conditions like `WHERE col = ''` (a 500 on non-string columns).
|
|
58
|
+
def active_filter_param?(filter)
|
|
59
|
+
return false unless filter_params.include?(filter.param)
|
|
60
|
+
|
|
61
|
+
value = filter_params[filter.param]
|
|
62
|
+
value == false || value.present?
|
|
63
|
+
end
|
|
52
64
|
end
|
|
53
65
|
end
|
data/lib/sift/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: procore-sift
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Procore Technologies
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-08-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|