allow access to classes when using hash conditions since you'll generally want to narrow it down with a database query

This commit is contained in:
Ryan Bates
2010-04-16 15:56:07 -07:00
parent 8903feee70
commit f46696348e
4 changed files with 8 additions and 5 deletions

View File

@@ -241,7 +241,9 @@ module CanCan
block_args += extra_args
defined_block.call(*block_args)
elsif defined_conditions
if subject.class != Class
if subject.class == Class
true
else
defined_conditions.all? do |name, value|
subject.send(name) == value
end