Sha256: a54d2436d61ba7b15e56ff2e272bfa3375545b19e0012193136585d2c523c43c

Contents?: true

Size: 1.21 KB

Versions: 27

Compression:

Stored size: 1.21 KB

Contents

class Card
  class ActManager
    class StageDirector
      module Phases
        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

        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

        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? && !@card.only_storage_phase
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
card-1.96.6 lib/card/act_manager/stage_director/phases.rb
card-1.96.5 lib/card/act_manager/stage_director/phases.rb
card-1.96.4 lib/card/act_manager/stage_director/phases.rb
card-1.96.3 lib/card/act_manager/stage_director/phases.rb
card-1.96.2 lib/card/act_manager/stage_director/phases.rb
card-1.96.1 lib/card/act_manager/stage_director/phases.rb
card-1.96.0 lib/card/act_manager/stage_director/phases.rb
card-1.95.3 lib/card/act_manager/stage_director/phases.rb
card-1.95.2 lib/card/act_manager/stage_director/phases.rb
card-1.95.1 lib/card/act_manager/stage_director/phases.rb
card-1.95.0 lib/card/act_manager/stage_director/phases.rb
card-1.94.1 lib/card/act_manager/stage_director/phases.rb
card-1.94.0 lib/card/act_manager/stage_director/phases.rb
card-1.93.13 lib/card/act_manager/stage_director/phases.rb
card-1.93.12 lib/card/act_manager/stage_director/phases.rb
card-1.93.11 lib/card/act_manager/stage_director/phases.rb
card-1.93.10 lib/card/act_manager/stage_director/phases.rb
card-1.93.9 lib/card/act_manager/stage_director/phases.rb
card-1.93.8 lib/card/act_manager/stage_director/phases.rb
card-1.93.7 lib/card/act_manager/stage_director/phases.rb