From 03d3f036a71d433c661d167596989ae6896e911c Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Wed, 31 Aug 2016 11:49:36 -0400 Subject: Override `respond_to_missing?` instead of `respond_to?` when possible This was almost every case where we are overriding `respond_to?` in a way that mirrors a parallel implementation of `method_missing`. There is one remaining case in Active Model that should probably do the same thing, but had a sufficiently strange implementation that I want to investigate it separately. Fixes #26333. --- activerecord/lib/active_record/relation/delegation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/relation') diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index e1c36982dd..d16de4b06c 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -108,7 +108,7 @@ module ActiveRecord end end - def respond_to?(method, include_private = false) + def respond_to_missing?(method, include_private = false) super || @klass.respond_to?(method, include_private) || arel.respond_to?(method, include_private) end -- cgit v1.2.3