allow to check ability by common module

This commit is contained in:
Sokolov Yura 2010-09-13 22:02:30 +08:00 committed by Ryan Bates
parent f236b1b5a4
commit e2c341b8d3

View File

@ -91,7 +91,7 @@ module CanCan
end end
def matches_subject_class?(subject) def matches_subject_class?(subject)
@subjects.any? { |sub| sub.kind_of?(Class) && (subject.kind_of?(sub) || subject.kind_of?(Class) && subject.ancestors.include?(sub)) } @subjects.any? { |sub| sub.kind_of?(Module) && (subject.kind_of?(sub) || subject.kind_of?(Module) && subject.ancestors.include?(sub)) }
end end
def matches_conditions_hash?(subject, conditions = @conditions) def matches_conditions_hash?(subject, conditions = @conditions)