calling controller's load_resource and authorize_resource from load_and_authorize_resource to maintain backwards compatability, even though it's not the most efficient way

This commit is contained in:
Ryan Bates
2009-11-26 09:53:16 -08:00
parent da5a5c031f
commit e32c5d0dfb
3 changed files with 8 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ module CanCan
# assert ability.cannot?(:destroy, Project.new)
# end
#
def can?(action, noun) # TODO this could use some refactoring
def can?(action, noun)
(@can_definitions || []).reverse.each do |base_behavior, defined_action, defined_noun, defined_block|
defined_actions = expand_actions(defined_action)
defined_nouns = [defined_noun].flatten