lib/zendesk2/client/collections/tickets.rb in zendesk2-1.6.1 vs lib/zendesk2/client/collections/tickets.rb in zendesk2-1.7.0
- old
+ new
@@ -3,12 +3,13 @@
include Zendesk2::Searchable
extend Zendesk2::Attributes
model Zendesk2::Client::Ticket
- attribute :requester_id, type: :integer
+ attribute :requester_id, type: :integer
attribute :collaborator_id, type: :integer
+ attribute :view_id, type: :integer
assoc_accessor :requester
assoc_accessor :collaborator
self.collection_root = "tickets"
@@ -19,10 +20,12 @@
def collection_page(params={})
collection_method = if requester_id
:get_requested_tickets
elsif collaborator_id
:get_ccd_tickets
+ elsif view_id
+ :get_view_tickets
else
:get_tickets
end
body = service.send(collection_method, Cistern::Hash.stringify_keys(self.attributes.merge(params))).body
@@ -32,6 +35,7 @@
self
end
scopes << :requester_id
scopes << :collaborator_id
+ scopes << :view_id
end