fetcheable_on_api 0.2.6 → 0.2.7
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/fetcheable_on_api/filterable.rb +4 -1
- data/lib/fetcheable_on_api/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: c4aca36d1f64be241c66898f0e1630953f73681ae0cc5a6edcff15343a91644e
|
|
4
|
+
data.tar.gz: 8541764efb77a70bfcb7a19171151d3d4ef95d86599ae12aa44a479ea89a0d32
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '095658031f64275ddff6554845421c39e90724a33add9c79a899ebcfe75b022d2a56a9f229d162e9e3e26f640b2df297683adf4757163e590fafc9ea1569a204'
|
|
7
|
+
data.tar.gz: 5d87970b1f0ef2929a52a8acb4ecc862d61aa375ddbd89a3418100b02f7bca5b5fb949b07ee1d647a224dc7be998a35003fb3d670c67c360021c1605d8746156
|
|
@@ -80,6 +80,7 @@ module FetcheableOnApi
|
|
|
80
80
|
keys = filters_configuration.keys
|
|
81
81
|
keys.each_with_index do |key, index|
|
|
82
82
|
predicate = filters_configuration[key.to_sym].fetch(:with, :ilike)
|
|
83
|
+
|
|
83
84
|
next if predicate.respond_to?(:call) ||
|
|
84
85
|
PREDICATES_WITH_ARRAY.exclude?(predicate.to_sym)
|
|
85
86
|
|
|
@@ -104,7 +105,9 @@ module FetcheableOnApi
|
|
|
104
105
|
klass = filters_configuration[column.to_sym].fetch(:class_name, collection.klass)
|
|
105
106
|
predicate = filters_configuration[column.to_sym].fetch(:with, :ilike)
|
|
106
107
|
|
|
107
|
-
if
|
|
108
|
+
if %i[between not_between].include?(predicate)
|
|
109
|
+
predicates(predicate, collection, klass, column_name, values.split(","))
|
|
110
|
+
elsif values.is_a?(String)
|
|
108
111
|
values.split(",").map do |value|
|
|
109
112
|
predicates(predicate, collection, klass, column_name, value)
|
|
110
113
|
end.inject(:or)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fetcheable_on_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fabien
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-03-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|