diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-06-24 13:07:39 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-06-24 13:07:39 -0300 |
commit | 2c203a94136d5b8681e2b2b55783ef6dde54405f (patch) | |
tree | 069cbe50eb900d0347770de957b87dc111d4cc6f /activerecord | |
parent | 4086ecea24446904bac4c69812f219ce7cbfbbba (diff) | |
download | rails-2c203a94136d5b8681e2b2b55783ef6dde54405f.tar.gz rails-2c203a94136d5b8681e2b2b55783ef6dde54405f.tar.bz2 rails-2c203a94136d5b8681e2b2b55783ef6dde54405f.zip |
Remove block definitions in finder methods.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 7a0c9dc612..f39951e16c 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -87,8 +87,8 @@ module ActiveRecord # 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 @@ module ActiveRecord 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? |