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
37
38
# 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
  unless e.class == Card::Error::Abort
    warn "exception in integrate phase: #{e.message}"
    warn e.backtrace.join "\n"
    @card.notable_exception_raised
  end
  return false
ensure
  @card.clear_changes_information unless @abort
  # ActManager.clear if main? && [email protected]_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