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.3.18 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.18 app/models2/resource_import_file_state_machine.rb
enju_biblio-0.3.17 app/models2/resource_import_file_state_machine.rb
enju_biblio-0.3.17 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.16 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.15 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.14 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.13 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.12 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.11 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.10 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.10.rc.3 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.10.rc.2 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.10.rc.1 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.9 app/models/resource_import_file_state_machine.rb
enju_biblio-0.4.0.rc.1 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.8 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.7 app/models/resource_import_file_state_machine.rb
enju_biblio-0.3.6 app/models/resource_import_file_state_machine.rb
enju_biblio-0.4.0.beta.2 app/models/resource_import_file_state_machine.rb