Sha256: 137232c95c829467ad8ae718daf2e1d85105c1dc852fd8cb86d10a226ad4bea8

Contents?: true

Size: 545 Bytes

Versions: 47

Compression:

Stored size: 545 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

47 entries across 44 versions & 2 rubygems

Version Path
enju_biblio-0.2.0.beta.1 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.3 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.2 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.1 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre71 app/models/resource_import_file_state_machine.rb
enju_biblio-0.1.0.pre70 app/models/resource_import_file_state_machine.rb