Skip to content

Commit 20efbf2

Browse files
committed
use respond_to_missing? not respond_to?
since Ruby 1.9.2, about 12 years ago, you're supposed to define respond_to_missing? if you also define method_missing. there's more explanation in this blog post by a ruby committer in 2010: http://blog.marc-andre.ca/2010/11/15/methodmissing-politely/
1 parent 2ca6d96 commit 20efbf2

File tree

1 file changed

+1
-1
lines changed
  • elasticsearch-model/lib/elasticsearch/model

1 file changed

+1
-1
lines changed

elasticsearch-model/lib/elasticsearch/model/proxy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def method_missing(method_name, *args, **kwargs, &block)
123123

124124
# Respond to methods from `@target`
125125
#
126-
def respond_to?(method_name, include_private = false)
126+
def respond_to_missing?(method_name, include_private = false)
127127
target.respond_to?(method_name) || super
128128
end
129129

0 commit comments

Comments
 (0)