Sha256: 2aaa844e5e904966a8486e57aae263b9cd7cdbba7ce9486b9346469b896b30b2

Contents?: true

Size: 791 Bytes

Versions: 2

Compression:

Stored size: 791 Bytes

Contents

require 'active_record'

class SilentPersistor < ActiveRecord::Base
  include AASM
  aasm :column => :status, :whiny_persistence => false do
    state :sleeping, :initial => true
    state :running
    event :run do
      transitions :to => :running, :from => :sleeping
    end
    event :sleep do
      transitions :to => :sleeping, :from => :running
    end
  end
  validates_presence_of :name
end

class MultipleSilentPersistor < ActiveRecord::Base
  include AASM
  aasm :left, :column => :status, :whiny_persistence => false do
    state :sleeping, :initial => true
    state :running
    event :run do
      transitions :to => :running, :from => :sleeping
    end
    event :sleep do
      transitions :to => :sleeping, :from => :running
    end
  end
  validates_presence_of :name
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aasm-4.11.1 spec/models/silent_persistor.rb
aasm-4.11.0 spec/models/silent_persistor.rb