Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
PATH
remote: .
specs:
cirro-ruby-client (1.6.1)
cirro-ruby-client (1.7.0)
faraday (< 1.2.0)
faraday_middleware
json_api_client (>= 1.10.0, <= 1.18.0)
json_api_client (>= 1.10.0)
jwt

GEM
remote: https://rubygems.org/
specs:
activemodel (6.1.3.2)
activesupport (= 6.1.3.2)
activesupport (6.1.3.2)
activemodel (6.1.5)
activesupport (= 6.1.5)
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.1)
coderay (1.1.3)
concurrent-ruby (1.1.7)
concurrent-ruby (1.1.10)
crack (0.4.4)
diff-lcs (1.4.4)
faker (2.14.0)
i18n (>= 1.6, < 2)
faraday (1.1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday_middleware (1.0.0)
faraday_middleware (1.2.0)
faraday (~> 1.0)
hashdiff (1.0.1)
i18n (1.8.5)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
json_api_client (1.18.0)
json_api_client (1.21.0)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
addressable (~> 2.2)
faraday (>= 0.15.2, < 1.2.0)
faraday_middleware (>= 0.9.0, < 1.2.0)
faraday (>= 0.15.2, < 2.0)
faraday_middleware (>= 0.9.0, < 2.0)
rack (>= 0.2)
jwt (2.2.3)
method_source (1.0.0)
minitest (5.14.4)
minitest (5.15.0)
multipart-post (2.1.1)
parallel (1.19.2)
parser (2.7.2.0)
Expand Down Expand Up @@ -85,15 +85,15 @@ GEM
rubocop-rspec (1.43.2)
rubocop (~> 0.87)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.4)
ruby2_keywords (0.0.5)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (1.7.0)
webmock (3.9.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.4.2)
zeitwerk (2.5.4)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion cirro-ruby-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'jwt'
spec.add_runtime_dependency 'faraday', '< 1.2.0'
spec.add_runtime_dependency 'faraday_middleware'
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
spec.add_runtime_dependency 'json_api_client', '>= 1.10.0'
end
20 changes: 20 additions & 0 deletions lib/cirro_io/client/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ def self.custom_connection
conn.use JsonApiClient::Middleware::Status, {}
end
end

# MonkeyPatch: https://github.com/JsonApiClient/json_api_client/issues/390
# waiting for json_api_client to release a new version with the fix
# https://github.com/JsonApiClient/json_api_client/pull/398
# rubocop:disable all
def initialize(params = {})
params = params.with_indifferent_access
@persisted = nil
@destroyed = nil
self.links = self.class.linker.new(params.delete(:links) || {})
self.relationships = self.class.relationship_linker.new(self.class, params.delete(:relationships) || {})
self.attributes = self.class.default_attributes.merge params.except(*self.class.prefix_params)
self.forget_change!(:type)
self.__belongs_to_params = params.slice(*self.class.prefix_params)

setup_default_properties

self.request_params = self.class.request_params_class.new(self.class)
end
# rubocop:enable all
end
end
end
2 changes: 1 addition & 1 deletion lib/cirro_io/client/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rubocop:disable Style/MutableConstant
module CirroIO
module Client
VERSION = '1.6.1'
VERSION = '1.7.0'
end
end
# rubocop:enable Style/MutableConstant