Skip to content

Instantly share code, notes, and snippets.

@justinlyman
Last active January 19, 2016 23:01
Show Gist options
  • Save justinlyman/f76ec6116a9660d50a2d to your computer and use it in GitHub Desktop.
Save justinlyman/f76ec6116a9660d50a2d to your computer and use it in GitHub Desktop.
Locking Example
commission_report.rb
def locked?
// if reviewed by manager and marker
// return true
// else
// return false
// end
end
abilty.rb
def initialize(user)
if user.has_role? :marketer
can :edit, :update, CommissionReport do |report|
!report.locked?
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment