Created
March 21, 2012 15:40
-
-
Save mjtko/2148668 to your computer and use it in GitHub Desktop.
Cancan ability definition for being able to edit any Project from an Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
can :edit_any, Array do |arr| | |
arr.any?{|p| p.is_a?(Project) && can?(:edit, p)} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment