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

22 lines
378 B
Ruby
Raw Normal View History

require 'active_record'
class Father < ActiveRecord::Base
include AASM
aasm do
state :missing_details, :initial => true
state :pending_details_confirmation
event :add_details do
transitions :from => :missing_details, :to => :pending_details_confirmation
end
end
def update_state
if may_add_details?
add_details!
end
end
end