Skip to content

Commit 2c203a9

Browse files
committed
Remove block definitions in finder methods.
1 parent 4086ece commit 2c203a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

activerecord/lib/active_record/relation/finder_methods.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ module FinderMethods
8787
# person.visits += 1
8888
# person.save!
8989
# end
90-
def find(*args, &block)
91-
return to_a.find(&block) if block_given?
90+
def find(*args)
91+
return to_a.find { |*block_args| yield(*block_args) } if block_given?
9292

9393
options = args.extract_options!
9494

@@ -259,8 +259,8 @@ def find_or_instantiator_by_attributes(match, attributes, *args)
259259
record
260260
end
261261

262-
def find_with_ids(*ids, &block)
263-
return to_a.find(&block) if block_given?
262+
def find_with_ids(*ids)
263+
return to_a.find { |*block_args| yield(*block_args) } if block_given?
264264

265265
expects_array = ids.first.kind_of?(Array)
266266
return ids.first if expects_array && ids.first.empty?

0 commit comments

Comments
 (0)