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

18 lines
352 B
Ruby

class GuardWithParamsMultiple
include AASM
aasm(:left) do
state :new, :reviewed, :finalized
event :mark_as_reviewed do
transitions :from => :new, :to => :reviewed, :guards => [:user_is_manager?]
end
end
def user_is_manager?(user)
ok = false
if user.has_role? :manager
ok = true
end
return ok
end
end