zendesk_api 1.14.4 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41aecd5a6945866190e24b38a016295887a8c525
4
- data.tar.gz: abcf62e81582832044555f4bddd19e330a57b1e9
3
+ metadata.gz: eb86ef3d8973e1a86275ced7816d925ef0fe38fb
4
+ data.tar.gz: 54f2a42245dc39949fce3915ff19d49d519e2e76
5
5
  SHA512:
6
- metadata.gz: 3df7e8dedec6089c7761f5c7be223fa44c4e34c9ab0c35d2eeaa1d8937d5f2b6329021d67033c3f9b851e6c2675c3fc4115801ff3b77c6cbaa7cd9313f333edb
7
- data.tar.gz: fcf9e2e0271c5ad83ffdba9ae0174f4cbe1ec8823fe5b79330cddefc30ebf943c6e1e99dda426f4fb5e94e9c729e7c007d645bdf64a1ebad3bd199f03c1b8f16
6
+ metadata.gz: 3e33068ac176420bf5dc1a71b5332814170ca95aa2651c7ab6616ebb299b78c363070ad64e6d38f506f4ec56dd58bc68ecabe1a226aa2c8719a05f33cd17061e
7
+ data.tar.gz: 4f712377c4b1fb8c81d95e2fb413e2e63fac5ba2bb551b920c7449a1c6345d77df245e12d7b0426bdfa527ea1d6930380cc3a70bb860d3a3a7aaa8f9da836447
@@ -276,15 +276,19 @@ module ZendeskAPI
276
276
  module UpdateMany
277
277
  # Updates multiple resources using the update_many endpoint.
278
278
  # @param [Client] client The {Client} object to be used
279
- # @param [Array] ids An array of ids to update
279
+ # @param [Array] ids_or_attributes An array of ids or arributes including ids to update
280
280
  # @param [Hash] attributes The attributes to update resources with
281
281
  # @return [JobStatus] the {JobStatus} instance for this destroy job
282
- def update_many!(client, ids, attributes)
282
+ def update_many!(client, ids_or_attributes, attributes = {})
283
283
  association = attributes.delete(:association) || Association.new(:class => self)
284
284
 
285
285
  response = client.connection.put("#{association.generate_path}/update_many") do |req|
286
- req.params = { :ids => ids.join(',') }
287
- req.body = { singular_resource_name => attributes }
286
+ if attributes == {}
287
+ req.body = { resource_name => ids_or_attributes }
288
+ else
289
+ req.params = { :ids => ids_or_attributes.join(',') }
290
+ req.body = { singular_resource_name => attributes }
291
+ end
288
292
 
289
293
  yield req if block_given?
290
294
  end
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.14.4"
2
+ VERSION = "1.15.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.4
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Davidovitz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-29 00:00:00.000000000 Z
12
+ date: 2017-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday