From d22ffa1625e28db1c1150d422c16686d71f69e6c Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 13 Aug 2017 18:17:21 +0900 Subject: Delegate to `Enumerable#find` for `CollectionProxy` Since `Relation` includes `Enumerable`, it is enough to use `super` simply. --- activerecord/lib/active_record/associations/collection_proxy.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/associations/collection_proxy.rb') 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 # # #, # # # # # ] - def find(*args, &block) - @association.find(*args, &block) + def find(*args) + return super if block_given? + @association.find(*args) end ## -- cgit v1.2.3