1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/guard_arguments_check.rb
2017-08-04 17:49:22 +05:30

17 lines
333 B
Ruby

class GuardArgumentsCheck
include AASM
aasm do
state :new, :reviewed, :finalized
event :mark_as_reviewed,
:guard => proc { |*args| arguments_list(*args) } do
transitions :from => :new, :to => :reviewed
end
end
def arguments_list(arg1, arg2)
return false unless arg1.nil?
true
end
end