Sha256: b9a61ee73977dc0f19ee889f87b80fa040becc259ffb02a79fafc617fa36d94e
Contents?: true
Size: 411 Bytes
Versions: 18
Compression:
Stored size: 411 Bytes
Contents
class GuardWithParams include AASM aasm 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 && user.has_role?(:manager) ok = true end return ok end end class GuardParamsClass def has_role?(role) true end end
Version data entries
18 entries across 18 versions & 1 rubygems