1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/timestamps_example.rb

20 lines
283 B
Ruby
Raw Normal View History

class TimestampsExample
include AASM
attr_accessor :opened_at
attr_reader :closed_at
aasm timestamps: true do
state :opened
state :closed
event :open do
transitions to: :opened
end
event :close do
transitions to: :closed
end
end
end