mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
143eedcd65
closes #418 closes #427
20 lines
343 B
Ruby
20 lines
343 B
Ruby
class TimestampExampleMongoid
|
|
include Mongoid::Document
|
|
include AASM
|
|
|
|
field :status, type: String
|
|
field :opened_at, type: Time
|
|
|
|
aasm column: :status, timestamps: true do
|
|
state :opened
|
|
state :closed
|
|
|
|
event :open do
|
|
transitions to: :opened
|
|
end
|
|
|
|
event :close do
|
|
transitions to: :closed
|
|
end
|
|
end
|
|
end
|