Skip to content

Instantly share code, notes, and snippets.

@mjtko
Created March 21, 2012 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjtko/2148668 to your computer and use it in GitHub Desktop.
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
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