Skip to content

Commit 6d6d783

Browse files
authored
Merge pull request #26 from test-IO/update_json_api_client
[#EPMCIR-203] Update json_api_client and bump version to 1.6.2
2 parents a43d5f1 + 47e8bdc commit 6d6d783

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

Gemfile.lock

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
PATH
22
remote: .
33
specs:
4-
cirro-ruby-client (1.6.1)
4+
cirro-ruby-client (1.6.2)
55
faraday (< 1.2.0)
66
faraday_middleware
7-
json_api_client (>= 1.10.0, <= 1.18.0)
7+
json_api_client (>= 1.10.0)
88
jwt
99

1010
GEM
1111
remote: https://rubygems.org/
1212
specs:
13-
activemodel (6.1.3.2)
14-
activesupport (= 6.1.3.2)
15-
activesupport (6.1.3.2)
13+
activemodel (7.0.2.3)
14+
activesupport (= 7.0.2.3)
15+
activesupport (7.0.2.3)
1616
concurrent-ruby (~> 1.0, >= 1.0.2)
1717
i18n (>= 1.6, < 2)
1818
minitest (>= 5.1)
1919
tzinfo (~> 2.0)
20-
zeitwerk (~> 2.3)
21-
addressable (2.7.0)
20+
addressable (2.8.0)
2221
public_suffix (>= 2.0.2, < 5.0)
2322
ast (2.4.1)
2423
coderay (1.1.3)
25-
concurrent-ruby (1.1.7)
24+
concurrent-ruby (1.1.10)
2625
crack (0.4.4)
2726
diff-lcs (1.4.4)
2827
faker (2.14.0)
2928
i18n (>= 1.6, < 2)
3029
faraday (1.1.0)
3130
multipart-post (>= 1.2, < 3)
3231
ruby2_keywords
33-
faraday_middleware (1.0.0)
32+
faraday_middleware (1.2.0)
3433
faraday (~> 1.0)
3534
hashdiff (1.0.1)
36-
i18n (1.8.5)
35+
i18n (1.10.0)
3736
concurrent-ruby (~> 1.0)
38-
json_api_client (1.18.0)
37+
json_api_client (1.21.0)
3938
activemodel (>= 3.2.0)
4039
activesupport (>= 3.2.0)
4140
addressable (~> 2.2)
42-
faraday (>= 0.15.2, < 1.2.0)
43-
faraday_middleware (>= 0.9.0, < 1.2.0)
41+
faraday (>= 0.15.2, < 2.0)
42+
faraday_middleware (>= 0.9.0, < 2.0)
4443
rack (>= 0.2)
45-
jwt (2.2.3)
44+
jwt (2.3.0)
4645
method_source (1.0.0)
47-
minitest (5.14.4)
46+
minitest (5.15.0)
4847
multipart-post (2.1.1)
4948
parallel (1.19.2)
5049
parser (2.7.2.0)
@@ -85,15 +84,14 @@ GEM
8584
rubocop-rspec (1.43.2)
8685
rubocop (~> 0.87)
8786
ruby-progressbar (1.10.1)
88-
ruby2_keywords (0.0.4)
87+
ruby2_keywords (0.0.5)
8988
tzinfo (2.0.4)
9089
concurrent-ruby (~> 1.0)
9190
unicode-display_width (1.7.0)
9291
webmock (3.9.1)
9392
addressable (>= 2.3.6)
9493
crack (>= 0.3.2)
9594
hashdiff (>= 0.4.0, < 2.0.0)
96-
zeitwerk (2.4.2)
9795

9896
PLATFORMS
9997
ruby

cirro-ruby-client.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
2828
spec.add_runtime_dependency 'jwt'
2929
spec.add_runtime_dependency 'faraday', '< 1.2.0'
3030
spec.add_runtime_dependency 'faraday_middleware'
31-
spec.add_runtime_dependency 'json_api_client', '>= 1.10.0', '<= 1.18.0' # TODO: see https://github.com/test-IO/cirro-ruby-client/issues/19
31+
spec.add_runtime_dependency 'json_api_client', '>= 1.10.0'
3232
end

lib/cirro_io/client/base.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ def self.custom_connection
2828
conn.use JsonApiClient::Middleware::Status, {}
2929
end
3030
end
31+
32+
# HACK: https://github.com/JsonApiClient/json_api_client/issues/390
33+
# waiting for json_api_client to release a new version with the fix
34+
# https://github.com/JsonApiClient/json_api_client/pull/398
35+
# rubocop:disable all
36+
def initialize(params = {})
37+
params = params.with_indifferent_access
38+
@persisted = nil
39+
@destroyed = nil
40+
self.links = self.class.linker.new(params.delete(:links) || {})
41+
self.relationships = self.class.relationship_linker.new(self.class, params.delete(:relationships) || {})
42+
self.attributes = self.class.default_attributes.merge params.except(*self.class.prefix_params)
43+
self.forget_change!(:type)
44+
self.__belongs_to_params = params.slice(*self.class.prefix_params)
45+
46+
setup_default_properties
47+
48+
self.request_params = self.class.request_params_class.new(self.class)
49+
end
50+
# rubocop:enable all
3151
end
3252
end
3353
end

lib/cirro_io/client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# rubocop:disable Style/MutableConstant
22
module CirroIO
33
module Client
4-
VERSION = '1.6.1'
4+
VERSION = '1.6.2'
55
end
66
end
77
# rubocop:enable Style/MutableConstant

0 commit comments

Comments
 (0)