aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-02-21 02:50:05 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-02-21 02:52:40 +0900
commit38c4ff377260265d96c737c51541e6ca630ea707 (patch)
treecf9e12b76f84da6a77e754ad5bb9beb0fb097464 /activerecord
parent673ed05ee96a9259ab329d909718240b9d63cc71 (diff)
downloadrails-38c4ff377260265d96c737c51541e6ca630ea707.tar.gz
rails-38c4ff377260265d96c737c51541e6ca630ea707.tar.bz2
rails-38c4ff377260265d96c737c51541e6ca630ea707.zip
Define `respond_to_missing?` instead of `respond_to?`
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb8
1 files changed, 4 insertions, 4 deletions
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)