Sha256: 954924ba40ad6ef51d5bf8c40c1b079988e563c757334459d462e1dbfc37750b

Contents?: true

Size: 785 Bytes

Versions: 17

Compression:

Stored size: 785 Bytes

Contents

module Pageflow
  module ImageFileStateMachine
    extend ActiveSupport::Concern

    included do
      state_machine :initial => 'not_processed' do
        extend StateMachineJob::Macro

        state 'not_processed'
        state 'processing'
        state 'processed'

        state 'processing_to_s3_failed'

        event :process do
          transition 'not_processed' => 'processing'
          transition 'processing_failed' => 'processing'
        end

        job ProcessImageFileJob do
          on_enter 'processing'
          result :ok => 'processed'
          result :error => 'processing_failed'
        end
      end
    end

    def retry!
      process!
    end

    def publish!
      process!
    end

    def retryable?
      processing_failed?
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pageflow-0.11.4 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.11.3 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.11.2 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.11.1 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.11.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.10.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.9.2 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.9.1 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.9.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.8.2 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.8.1 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.8.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.7.2 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.7.1 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.7.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.6.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.5.0 app/state_machines/pageflow/image_file_state_machine.rb