Skip to content

Commit 625e7fe

Browse files
committed
Use backwards-compatible size instead of length to check association proxy.
1 parent 8976405 commit 625e7fe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/declarative_authorization/authorization.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def validate? (attr_validator, object = nil, hash = nil)
513513
return false unless object
514514

515515
if Authorization.is_a_association_proxy?(object)
516-
return false unless object.length > 0
516+
return false if object.empty?
517517
object.each do |member|
518518
return true if validate?(attr_validator, member, hash)
519519
end

0 commit comments

Comments
 (0)