Module: Card::ActManager::StageDirector::Phases

Included in:
Card::ActManager::StageDirector
Defined in:
lib/card/act_manager/stage_director/phases.rb

Instance Method Summary collapse

Instance Method Details

#integration_phaseObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/card/act_manager/stage_director/phases.rb', line 23

def integration_phase
  return if @abort

  @card.restore_changes_information
  run_single_stage :integrate
  run_single_stage :after_integrate
  run_single_stage :integrate_with_delay
ensure
  @card.clear_changes_information unless @abort
  # ActManager.clear if main? && [email protected]_storage_phase
end

#storage_phase(&block) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/card/act_manager/stage_director/phases.rb', line 14

def storage_phase &block
  catch_up_to_stage :prepare_to_store
  run_single_stage :store, &block
  run_single_stage :finalize
  raise ActiveRecord::RecordInvalid, @card if @card.errors.any?
ensure
  @from_trash = nil
end

#validation_phaseObject



5
6
7
8
9
10
11
12
# File 'lib/card/act_manager/stage_director/phases.rb', line 5

def validation_phase
  run_single_stage :initialize
  run_single_stage :prepare_to_validate
  run_single_stage :validate
ensure
  # @card.expire_pieces if @card.errors.any?
  @card.errors.empty?
end