aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/collection_proxy.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-08-13 20:14:34 +0930
committerGitHub <noreply@github.com>2017-08-13 20:14:34 +0930
commit3e676822c05f1166e2880f162c864c3655eaa281 (patch)
treeced5b0ba87df2d6b1212c72255bfbb6d4d7b481e /activerecord/lib/active_record/associations/collection_proxy.rb
parente3962308e7947f3d99c70c192e2d1356d3420e1e (diff)
parentd22ffa1625e28db1c1150d422c16686d71f69e6c (diff)
downloadrails-3e676822c05f1166e2880f162c864c3655eaa281.tar.gz
rails-3e676822c05f1166e2880f162c864c3655eaa281.tar.bz2
rails-3e676822c05f1166e2880f162c864c3655eaa281.zip
Merge pull request #30226 from kamipo/delegate_to_enumerable_find
Delegate to `Enumerable#find` for `CollectionProxy`
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_proxy.rb')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb
index 0678b07699..412e89255d 100644
--- a/activerecord/lib/active_record/associations/collection_proxy.rb
+++ b/activerecord/lib/active_record/associations/collection_proxy.rb
@@ -135,8 +135,9 @@ module ActiveRecord
# # #<Pet id: 2, name: "Spook", person_id: 1>,
# # #<Pet id: 3, name: "Choo-Choo", person_id: 1>
# # ]
- def find(*args, &block)
- @association.find(*args, &block)
+ def find(*args)
+ return super if block_given?
+ @association.find(*args)
end
##