Permalink
Browse files

Remove block definitions in finder methods.

  • Loading branch information...
miloops committed Jun 24, 2010
1 parent 4086ece commit 2c203a94136d5b8681e2b2b55783ef6dde54405f
Showing with 4 additions and 4 deletions.
  1. +4 −4 activerecord/lib/active_record/relation/finder_methods.rb
@@ -87,8 +87,8 @@ module FinderMethods
# person.visits += 1
# person.save!
# end
- def find(*args, &block)
- return to_a.find(&block) if block_given?
+ def find(*args)
+ return to_a.find { |*block_args| yield(*block_args) } if block_given?
options = args.extract_options!
@@ -259,8 +259,8 @@ def find_or_instantiator_by_attributes(match, attributes, *args)
record
end
- def find_with_ids(*ids, &block)
- return to_a.find(&block) if block_given?
+ def find_with_ids(*ids)
+ return to_a.find { |*block_args| yield(*block_args) } if block_given?
expects_array = ids.first.kind_of?(Array)
return ids.first if expects_array && ids.first.empty?

0 comments on commit 2c203a9

Please sign in to comment.