Sha256: 9f522413df7b8d03ffb1a56948a5085ebd08999494a30d6e8fb264600ab6c610
Contents?: true
Size: 799 Bytes
Versions: 17
Compression:
Stored size: 799 Bytes
Contents
class ComplexActiveRecordExample < ActiveRecord::Base include AASM aasm :left, :column => 'left' do state :one, :initial => true state :two state :three event :increment do transitions :from => :one, :to => :two, guard: :allowed? transitions :from => :two, :to => :three end event :reset do transitions :from => :three, :to => :one end end def allowed? true end aasm :right, :column => 'right' do state :alpha, :initial => true state :beta state :gamma event :level_up do transitions :from => :alpha, :to => :beta transitions :from => :beta, :to => :gamma end event :level_down do transitions :from => :gamma, :to => :beta transitions :from => :beta, :to => :alpha end end end
Version data entries
17 entries across 17 versions & 1 rubygems