From 38c4ff377260265d96c737c51541e6ca630ea707 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Tue, 21 Feb 2017 02:50:05 +0900 Subject: Define `respond_to_missing?` instead of `respond_to?` --- activerecord/lib/active_record/associations/collection_proxy.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 5b84351ef1..6616de9f7f 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -1116,10 +1116,6 @@ module ActiveRecord self end - def respond_to?(name, include_private = false) - super || scope.respond_to?(name, include_private) - end - delegate_methods = [ QueryMethods, SpawnMethods, @@ -1153,6 +1149,10 @@ module ActiveRecord load_target end + def respond_to_missing?(method, _) + scope.respond_to?(method) || super + end + def method_missing(method, *args, &block) if scope.respond_to?(method) scope.public_send(method, *args, &block) -- cgit v1.2.3