zendesk / zendesk_api_client_rb

Official Ruby Zendesk API Client
http://developer.zendesk.com/
Apache License 2.0
387 stars 183 forks source link

Unable to destroy_many! #350

Closed alexevanczuk closed 7 years ago

alexevanczuk commented 7 years ago

It's not clear how to destroy_many!

There is nothing in the documentation. I tried reading through the source and lsing into the class, but lots of meta-programming makes this difficult. For example:

$zdclient.tickets.methods.include?(:destroy_many!)
true
$zdclient.tickets.destroy_many!
NoMethodError: undefined method "destroy_many!" for ZendeskAPI::Ticket
from /Users/alex.evanczuk/.gem/ruby/2.3.5/gems/zendesk_api-1.9.5/lib/zendesk_api/collection.rb:74:in `block (2 levels) in <class:Collection>'

I tried this as well, but it did not work either:

collection = ZendeskAPI::Collection.new($zdclient, ZendeskAPI::Ticket)
collection.destroy_many(ids: [1296448])
alexevanczuk commented 7 years ago

Closing this out too -- my apologies, I was using an outdated version of the API.