Permalink
Browse files

Don't use method_missing when we don't have to

  • Loading branch information...
1 parent 2e24cf7 commit 0645fd2c80c05109f148e28cdf78d636406cb6d7 @jonleighton jonleighton committed Jan 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/associations/association_collection.rb
@@ -257,7 +257,7 @@ def empty?
def any?
if block_given?
- method_missing(:any?) { |*block_args| yield(*block_args) }
+ load_target.any? { |*block_args| yield(*block_args) }
else
!empty?
end
@@ -266,7 +266,7 @@ def any?
# Returns true if the collection has more than 1 record. Equivalent to collection.size > 1.
def many?
if block_given?
- method_missing(:many?) { |*block_args| yield(*block_args) }
+ load_target.many? { |*block_args| yield(*block_args) }
else
size > 1
end

0 comments on commit 0645fd2

Please sign in to comment.