lib/roart/ticket_page.rb in roart-0.1.8 vs lib/roart/ticket_page.rb in roart-0.1.9
- old
+ new
@@ -5,11 +5,11 @@
IntKeys = %w[id]
def to_hash
hash = HashWithIndifferentAccess.new
self.delete_if{|x| !x.include?(":")}
- raise TicketNotFoundError, "No tickets matching search criteria found." if self.size == 0
+ return false if self.size == 0
self.each do |ln|
ln = ln.split(":")
key = nil
if ln[0] && ln[0].match(/^CF-.+/)
key = ln.delete_at(0)
@@ -26,10 +26,11 @@
def to_search_list_array
array = Array.new
self.each do |ticket|
ticket.extend(Roart::TicketPage)
- array << ticket.to_hash
+ ticket_hash = ticket.to_hash
+ array << ticket_hash if ticket_hash
end
array
end
def to_search_array
\ No newline at end of file