Sha256: ca265c63010a46f98c533597549fb137cac6bb88d4e683ce2d3398f8afc37e85

Contents?: true

Size: 732 Bytes

Versions: 10

Compression:

Stored size: 732 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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pageflow-0.4.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.3.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.2.1 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.2.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.1.0 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.0.5 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.0.4 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.0.3 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.0.2 app/state_machines/pageflow/image_file_state_machine.rb
pageflow-0.0.1 app/state_machines/pageflow/image_file_state_machine.rb