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