From 4877703482e1c6543a709ddbdc040fcb2ffc3e2f Mon Sep 17 00:00:00 2001 From: Greg Bright Date: Mon, 24 Nov 2025 14:37:18 -0500 Subject: [PATCH] fix: Correct code around CreateOrUpdateMany call modified zendesk_api_client_rb/lib/zendesk_api/actions.rb - Add association param with default to the function params modified zendesk_api_client_rb/lib/zendesk_api/collection.rb - Add 'create_or_update_many!' to the list of functions to create with Array arguments --- lib/zendesk_api/actions.rb | 3 +-- lib/zendesk_api/collection.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/zendesk_api/actions.rb b/lib/zendesk_api/actions.rb index 0bc4d9fc..9a403d7a 100644 --- a/lib/zendesk_api/actions.rb +++ b/lib/zendesk_api/actions.rb @@ -203,8 +203,7 @@ module CreateOrUpdateMany # @param [Array] attributes The attributes to update resources with # # @return [JobStatus] the {JobStatus} instance for this destroy job - def create_or_update_many!(client, attributes) - association = Association.new(class: self) + def create_or_update_many!(client, attributes, association = Association.new(class: self)) response = client.connection.post("#{association.generate_path}/create_or_update_many") do |req| req.body = {resource_name => attributes} diff --git a/lib/zendesk_api/collection.rb b/lib/zendesk_api/collection.rb index 545633e5..17d25cfc 100644 --- a/lib/zendesk_api/collection.rb +++ b/lib/zendesk_api/collection.rb @@ -68,7 +68,7 @@ def initialize(client, resource, options = {}) end # Methods that take an Array argument - methods = %w[create_many! destroy_many!] + methods = %w[create_many! destroy_many! create_or_update_many!] methods.each do |deferrable| # Passes arguments and the proper path to the resource class method. # @param [Array] array arguments