Follow up: Implemented Ticket.process_pending. Fixed UnitTests for setting up new system.

This commit is contained in:
Thorsten Eckel 2015-05-21 16:50:28 +02:00
parent bf86afb056
commit 6511a70ff8
2 changed files with 9 additions and 6 deletions

View file

@ -7,11 +7,14 @@ class ProcessPendingTickets < ActiveRecord::Migration
pending_close_state = Ticket::State.find_by(
name: 'pending close',
)
closed_state = Ticket::State.find_by(
name: 'closed',
)
pending_close_state.next_state_id = closed_state.id
pending_close_state.save!
if pending_close_state
closed_state = Ticket::State.find_by(
name: 'closed',
)
pending_close_state.next_state_id = closed_state.id
pending_close_state.save!
end
# add Ticket.process_pending
Scheduler.create_or_update(

View file

@ -1366,7 +1366,7 @@ Ticket::State.create_if_not_exists( id: 3, name: 'pending reminder', state_type_
Ticket::State.create_if_not_exists( id: 4, name: 'closed', state_type_id: Ticket::StateType.where(name: 'closed').first.id )
Ticket::State.create_if_not_exists( id: 5, name: 'merged', state_type_id: Ticket::StateType.where(name: 'merged').first.id )
Ticket::State.create_if_not_exists( id: 6, name: 'removed', state_type_id: Ticket::StateType.where(name: 'removed').first.id, active: false )
Ticket::State.create_if_not_exists( id: 7, name: 'pending close', state_type_id: Ticket::StateType.where(name: 'pending action').first.id, next_state_id: 5 )
Ticket::State.create_if_not_exists( id: 7, name: 'pending close', state_type_id: Ticket::StateType.where(name: 'pending action').first.id, next_state_id: 4 )
Ticket::Priority.create_if_not_exists( id: 1, name: '1 low' )
Ticket::Priority.create_if_not_exists( id: 2, name: '2 normal' )