diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/association_collection.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index b8337fe4d9..66b4079f55 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -116,9 +116,13 @@ module ActiveRecord def empty? size.zero? end - - def any? - !empty? + + def any?(&block) + if block_given? + method_missing(:any?, &block) + else + !empty? + end end def uniq(collection = self) |