 
 
 
-class Scheduler.Tickets extends Backbone.Collection
+class Scheduler.Tickets extends @Tickets
   model: Scheduler.Ticket
   
   numbered: (numbers)->

    String.fromCharCode(bytes)
  
  parse: (ticket)->
    if ticket.extendedAttributes
      ticket.sequence = +ticket.extendedAttributes['sequence']
      ticket.sequence = null if !ticket.sequence

  waitingForDiscussion: -> @scoped (ticket)-> ticket.waitingForDiscussion()
  postponed: -> @scoped (ticket)-> !!ticket.get('postponed')
  unpostponed: -> @scoped (ticket)-> !ticket.get('postponed')
  
  sorterFor: (attribute)->
    switch attribute
      when 'sequence'     then (ticket)-> +ticket.get('sequence')
      else                super(attribute)

  scoped: (filter)-> new Scheduler.Tickets(@select(filter))
