magentwo 0.1.83 → 0.1.84
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/filter.rb +9 -2
- data/magentwo.gemspec +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: adcb433fd8d46b83ef5d89919f7458c9b3cf66c305dfefa5dda9847241b12db1
|
4
|
+
data.tar.gz: 83b23e44c235493a1db438db4a55ffc1ba4f1ea6f32e822a7d417e014f0666c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a1a25c71c970ecc41523a37651751ade3ed48f7129fdc6dfa140d213f32f3b6de4e4ef6cfe2721b421969b4ce7473267468b23a4cb25fa9b7c576f47c888116
|
7
|
+
data.tar.gz: 27cdc022eae14d7cd0e2900c8cb1c380dc6110eafccffd634388b9727b3d0729c4a5b6563a1c39731055526a26a07b8711a3955642f8826d01422c4f6c1d7761
|
data/lib/filter.rb
CHANGED
@@ -7,7 +7,7 @@ module Magentwo
|
|
7
7
|
@value = value
|
8
8
|
end
|
9
9
|
|
10
|
-
def to_query idx
|
10
|
+
def to_query idx, field:self.field, value:self.value
|
11
11
|
[
|
12
12
|
"searchCriteria[filter_groups][#{idx}][filters][0][field]=#{self.field}",
|
13
13
|
"searchCriteria[filter_groups][#{idx}][filters][0][value]=#{URI::encode(self.value.to_s)}",
|
@@ -21,7 +21,7 @@ module Magentwo
|
|
21
21
|
end
|
22
22
|
|
23
23
|
class CompareArray < Compare
|
24
|
-
def to_query
|
24
|
+
def to_query id
|
25
25
|
[
|
26
26
|
"searchCriteria[filter_groups][#{idx}][filters][0][field]=#{self.field}",
|
27
27
|
"searchCriteria[filter_groups][#{idx}][filters][0][value]=#{URI::encode(self.value.map(&:to_s).join(","))}",
|
@@ -98,6 +98,13 @@ module Magentwo
|
|
98
98
|
end
|
99
99
|
|
100
100
|
class From < Magentwo::Filter::Compare
|
101
|
+
def to_query idx
|
102
|
+
value = case self.value
|
103
|
+
when Time then self.value.utc
|
104
|
+
else self.value
|
105
|
+
end
|
106
|
+
super idx, value:value
|
107
|
+
end
|
101
108
|
end
|
102
109
|
|
103
110
|
class To < Magentwo::Filter::Compare
|
data/magentwo.gemspec
CHANGED