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



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

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
rescue => e # don't rollback
  Card::Error.current = e
  warn "exception in integrate stage: #{e.message}"
  warn e.backtrace.join "\n"
  @card.notable_exception_raised
  return false
ensure
  @card.clear_changes_information unless @abort
  ActManager.clear if main? && !@card.only_storage_phase
end

#storage_phase(&block) ⇒ Object



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

def storage_phase &block
  catch_up_to_stage :prepare_to_store
  run_single_stage :store, &block
  run_single_stage :finalize
ensure
  @from_trash = nil
end

#validation_phaseObject



5
6
7
8
9
10
11
# 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
  @card.expire_pieces if @card.errors.any?
  @card.errors.empty?
end