Sha256: 80cc2880556e1698d64cbc3ab79e0b5e62bda782400b0a99055fd2b4e207462b

Contents?: true

Size: 544 Bytes

Versions: 17

Compression:

Stored size: 544 Bytes

Contents

class ResourceImportFileStateMachine
  include Statesman::Machine

  state :pending, initial: true
  state :started
  state :completed
  state :failed

  transition from: :pending, to: [:started, :failed]
  transition from: :started, to: [:completed, :failed]

  after_transition(from: :pending, to: :started) do |resource_import_file|
    resource_import_file.update_column(:executed_at, Time.zone.now)
  end

  before_transition(from: :started, to: :completed) do |resource_import_file|
    resource_import_file.error_message = nil
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre69 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre68 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre67 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre66 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre65 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre64 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre63 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre62 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre61 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre60 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre59 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre58 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre57 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre56 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre55 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre54 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre53 app/models/resource_import_file_state_machine.rb