Add check for Enumerable as condition value

This commit is contained in:
Aryk Grosz
2012-04-23 00:51:55 -07:00
parent aed37cda03
commit 65bbf0e354
2 changed files with 10 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ module CanCan
else
!attribute.nil? && matches_conditions_hash?(attribute, value)
end
elsif value.kind_of?(Array) || value.kind_of?(Range)
elsif value.kind_of?(Enumerable)
value.include? attribute
else
attribute == value