Added two new categories.
This commit is contained in:
parent
18893526d9
commit
4fea5e12d7
1 changed files with 9 additions and 1 deletions
|
@ -9,7 +9,7 @@ class Ticket::State < ApplicationModel
|
||||||
|
|
||||||
list tickets by customer
|
list tickets by customer
|
||||||
|
|
||||||
states = Ticket::State.by_category('open') # open|closed
|
states = Ticket::State.by_category('open') # open|closed|work_on|pending_reminder
|
||||||
|
|
||||||
returns:
|
returns:
|
||||||
|
|
||||||
|
@ -22,6 +22,14 @@ returns:
|
||||||
return Ticket::State.where(
|
return Ticket::State.where(
|
||||||
state_type_id: Ticket::StateType.where( name: ['new', 'open', 'pending reminder', 'pending action'] )
|
state_type_id: Ticket::StateType.where( name: ['new', 'open', 'pending reminder', 'pending action'] )
|
||||||
)
|
)
|
||||||
|
elsif category == 'pending_reminder'
|
||||||
|
return Ticket::State.where(
|
||||||
|
state_type_id: Ticket::StateType.where( name: ['pending reminder'] )
|
||||||
|
)
|
||||||
|
elsif category == 'work_on'
|
||||||
|
return Ticket::State.where(
|
||||||
|
state_type_id: Ticket::StateType.where( name: ['new', 'open'] )
|
||||||
|
)
|
||||||
elsif category == 'closed'
|
elsif category == 'closed'
|
||||||
return Ticket::State.where(
|
return Ticket::State.where(
|
||||||
state_type_id: Ticket::StateType.where( name: ['closed'] )
|
state_type_id: Ticket::StateType.where( name: ['closed'] )
|
||||||
|
|
Loading…
Reference in a new issue