@@ -61,7 +61,7 @@ def initialize(client, resource, options = {})
6161 end
6262
6363 args << { } unless args . last . is_a? ( Hash )
64- args . last . merge! ( association : @association )
64+ args . last [ :association ] = @association
6565
6666 @resource_class . send ( deferrable , @client , *args )
6767 end
@@ -161,7 +161,7 @@ def path
161161 def fetch! ( reload = false )
162162 if @resources && ( !@fetchable || !reload )
163163 return @resources
164- elsif association && association . options . parent && association . options . parent . new_record?
164+ elsif association & .options &. parent & .new_record?
165165 return ( @resources = [ ] )
166166 end
167167
@@ -389,7 +389,7 @@ def get_response(path)
389389 @client . connection . send ( @verb || "get" , path ) do |req |
390390 opts = @options . delete_if { |_ , v | v . nil? }
391391
392- req . params . merge! ( include : @includes . join ( "," ) ) if @includes . any?
392+ req . params [ :include ] = @includes . join ( "," ) if @includes . any?
393393
394394 if %w[ put post ] . include? ( @verb . to_s )
395395 req . body = opts
@@ -444,7 +444,7 @@ def wrap_resource(res, with_association = with_association?)
444444 @resource_class . new ( @client , res )
445445 else
446446 res = { id : res }
447- res . merge! ( association : @association ) if with_association
447+ res [ :association ] = @association if with_association
448448 @resource_class . new ( @client , res )
449449 end
450450 end
@@ -464,7 +464,8 @@ def array_method(name, ...)
464464 # If you call client.tickets.foo - and foo is not an attribute nor an association, it ends up here, as a new collection
465465 def next_collection ( name , *args , &)
466466 opts = args . last . is_a? ( Hash ) ? args . last : { }
467- opts . merge! ( collection_path : [ *@collection_path , name ] , page : nil )
467+ opts [ :collection_path ] = [ *@collection_path , name ]
468+ opts [ :page ] = nil
468469 # Why `page: nil`?
469470 # when you do client.tickets.fetch followed by client.tickets.foos => the request to /tickets/foos will
470471 # have the options page set to whatever the last options were for the tickets collection
0 commit comments