1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/sequel/sequel_simple.rb
2015-07-11 22:36:07 +12:00

25 lines
536 B
Ruby

db = Sequel.connect(SEQUEL_DB)
# if you want to see the statements while running the spec enable the following line
# db.loggers << Logger.new($stderr)
db.create_table(:simples) do
primary_key :id
String :status
end
class SequelSimple < Sequel::Model(db)
set_dataset(:simples)
include AASM
attr_accessor :default
aasm :column => :status
aasm do
state :alpha, :initial => true
state :beta
state :gamma
event :release do
transitions :from => [:alpha, :beta, :gamma], :to => :beta
end
end
end