flex_commerce_api 0.6.57 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8df21fbb808a597a47e3ce03e124cde9285e26bbfdafe37af9783eed3fc43571
4
- data.tar.gz: 1b628de8125b13534465116d350a5b9c6b79ff3227012857a874b8d8ea6a043e
3
+ metadata.gz: 30004ed9299f30f35981aab7dfebe49fb3665449c02f827c86d1e678e66d8776
4
+ data.tar.gz: ea5dcde40fca7ded2737675da0f0208ab2846b7fe4266769cf56b49275104a3a
5
5
  SHA512:
6
- metadata.gz: fa63b986f6e5deae7834142534a7eb2051c2a5c4eeadf6059fefd578fbf83b4211fb890d27516a2bbbbfbaeec6f6fbae068c03d4e8c8598a79e3237023ea6d3f
7
- data.tar.gz: d4d71f00eceda350a4824bf3d383409e3bbbf473042f7c6bbffe8078cf6ae3988dc77c0c2d07b4fd7e0e67fe56d9c4258ec7a88765f69c33a91c9c3ef2adbafb
6
+ metadata.gz: 5fb1d9ddc76030328010fa15f3985d9594650e603b399ecde71832d25fc2dcf7365305f30e09a38ee68baca6a4986ee779bd9d3965e40ae1316af9a150cc169f
7
+ data.tar.gz: ffcd68fc795a6221fd17b391f1859ebf4a142d0842c71f134d40077ac6c77154a2ad1be8e771e1336310298f6008bfb7952830fd34b911c773d11258dd543a51
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "json_matchers", ["~> 0.5", ">= 0.5.1"]
35
35
 
36
36
  spec.add_dependency "oj", "~> 2.12"
37
- spec.add_runtime_dependency "json_api_client", "1.1.1"
37
+ spec.add_runtime_dependency "json_api_client", "1.5.3"
38
38
  spec.add_runtime_dependency "activesupport", ">= 4.0"
39
39
  spec.add_runtime_dependency "rack", ">= 1.6"
40
40
  spec.add_runtime_dependency "faraday-http-cache", "1.3.0"
@@ -17,6 +17,9 @@ require "flex_commerce_api/json_api_client_extension/parsers/parser"
17
17
  require "flex_commerce_api/json_api_client_extension/remote_builder"
18
18
 
19
19
  module FlexCommerceApi
20
+ JsonApiClientExtension::Paginator.page_param = "number"
21
+ JsonApiClientExtension::Paginator.per_page_param = "size"
22
+
20
23
  #
21
24
  # Base class for all flex commerce models
22
25
  #
@@ -1,3 +1,3 @@
1
1
  module FlexCommerceApi
2
- VERSION = '0.6.57'
2
+ VERSION = '0.7'
3
3
  end
@@ -0,0 +1,17 @@
1
+ module JsonApiClient
2
+ module Query
3
+ class Builder
4
+ # This is a workaround because in the json_api_client gem they now parse
5
+ # the "last" link instead of the original behaviour:
6
+ # https://github.com/JsonApiClient/json_api_client/blob/v1.5.3/lib/json_api_client/query/builder.rb#L69
7
+ # This causes an error when Faraday parses our params due to the filter
8
+ # param appearing to be malformed.
9
+ #
10
+ # TODO: Look at fixing our links so that we can remove this workaround
11
+ # (platform ticket #7293)
12
+ def last
13
+ self.to_a.last
14
+ end
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flex_commerce_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.57
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-05 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -218,14 +218,14 @@ dependencies:
218
218
  requirements:
219
219
  - - '='
220
220
  - !ruby/object:Gem::Version
221
- version: 1.1.1
221
+ version: 1.5.3
222
222
  type: :runtime
223
223
  prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - '='
227
227
  - !ruby/object:Gem::Version
228
- version: 1.1.1
228
+ version: 1.5.3
229
229
  - !ruby/object:Gem::Dependency
230
230
  name: activesupport
231
231
  requirement: !ruby/object:Gem::Requirement
@@ -403,7 +403,7 @@ files:
403
403
  - lib/json_erb.rb
404
404
  - lib/json_struct.rb
405
405
  - lib/patches.rb
406
- - lib/patches/json_api_client/resource.rb
406
+ - lib/patches/json_api_client/builder.rb
407
407
  - lib/paypal_express.rb
408
408
  - lib/paypal_express/additional_info.rb
409
409
  - lib/paypal_express/api.rb
@@ -1,50 +0,0 @@
1
- require "json_api_client/version"
2
- if ["1.1.1"].include?(JsonApiClient::VERSION)
3
- require "json_api_client/resource"
4
- module JsonApiClient
5
- class Resource
6
- def save
7
- return false unless valid?
8
-
9
- self.last_result_set = if persisted?
10
- self.class.requestor.update(self)
11
- else
12
- self.class.requestor.create(self)
13
- end
14
-
15
- if last_result_set.has_errors?
16
- last_result_set.errors.each do |error|
17
- if error.source_parameter
18
- errors.add(error.source_parameter, error.title || error.detail)
19
- else
20
- errors.add(:base, error.title || error.detail)
21
- end
22
- end
23
- false
24
- else
25
- self.errors.clear if self.errors
26
- mark_as_persisted!
27
- if updated = last_result_set.first
28
- self.attributes = updated.attributes
29
- # This line has been added as part of https://github.com/chingor13/json_api_client/pull/238
30
- self.links.attributes = updated.links.attributes
31
- self.relationships.attributes = updated.relationships.attributes
32
- clear_changes_information
33
- # This line has been added as part of https://github.com/JsonApiClient/json_api_client/pull/285
34
- self.relationships.clear_changes_information
35
- end
36
- true
37
- end
38
- end
39
- end
40
- end
41
- else
42
- raise %q(
43
- Please check these two PRs:
44
- * https://github.com/chingor13/json_api_client/pull/238 (This was released in version 1.5.0)
45
- * https://github.com/JsonApiClient/json_api_client/pull/285 (This hasn't yet been released at the time of writing this)
46
-
47
- If both have been merged into the gem version you are using, remove this file (#{__FILE__}).
48
- If not, add the current version to the allowed array at the top of this file.
49
- )
50
- end