1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/callbacks/with_state_arg.rb
Anil Maurya a8ceb82b04 Fix callback argument for :before_success & :success callback.
Simplify readme for callback arguments
2019-05-20 17:56:52 +05:30

34 lines
845 B
Ruby

module Callbacks
class WithStateArg
include AASM
aasm do
state :open, :initial => true
state :closed
state :out_to_lunch
event :close, :before => :before_method, :after => :after_method, :before_success => :before_success_method, :success => :success_method3 do
transitions :to => :closed, :from => [:open], :after => :transition_method, :success => :success_method
transitions :to => :out_to_lunch, :from => [:open], :after => :transition_method2, :success => :success_method2
end
end
def before_method(arg); end
def before_success_method(arg); end
def after_method(arg); end
def transition_method(arg); end
def transition_method2(arg); end
def success_method(arg); end
def success_method2(arg); end
def success_method3(arg); end
end
end