magentwo 0.1.83 → 0.1.84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/filter.rb +9 -2
  3. data/magentwo.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8971d5fe11cfc1ec134a18f9af85f9dcca858ca2068ed85a7cc7af82b520105b
4
- data.tar.gz: 70c047455ec6ca0773f4274c21b5bd1c7af151972c6adbab99e1aced62b1fd04
3
+ metadata.gz: adcb433fd8d46b83ef5d89919f7458c9b3cf66c305dfefa5dda9847241b12db1
4
+ data.tar.gz: 83b23e44c235493a1db438db4a55ffc1ba4f1ea6f32e822a7d417e014f0666c6
5
5
  SHA512:
6
- metadata.gz: b564e84256ee706f9f0ac8fa5437bc3cdd8ece89bae0467181eddce99fd9747f12ee1c6d758e7dcc6ee8dfe24bd5ef20981a89c453f38efdfb64845dd8465954
7
- data.tar.gz: 05f575ebbb8541056bddc170f441f0ae99e4c89b54a3bdef0b9e390c44ce89e6dd53208dc008894843b38413fef6c883ebae2f4cbae413ad614b1b1a4850164d
6
+ metadata.gz: 0a1a25c71c970ecc41523a37651751ade3ed48f7129fdc6dfa140d213f32f3b6de4e4ef6cfe2721b421969b4ce7473267468b23a4cb25fa9b7c576f47c888116
7
+ data.tar.gz: 27cdc022eae14d7cd0e2900c8cb1c380dc6110eafccffd634388b9727b3d0729c4a5b6563a1c39731055526a26a07b8711a3955642f8826d01422c4f6c1d7761
@@ -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 idx
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'magentwo'
3
- s.version = '0.1.83'
3
+ s.version = '0.1.84'
4
4
  s.date = '2019-01-17'
5
5
  s.summary = "Magento 2 API Wrapper"
6
6
  s.description = "Provides a simple Ruby Interface to interact with the Magento 2 API"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magentwo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.83
4
+ version: 0.1.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Mueß