aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-04-25 17:38:56 -0700
committerGitHub <noreply@github.com>2017-04-25 17:38:56 -0700
commitc7ee244644903da5045c54f72e25a8ee6eb3bd68 (patch)
treea2359c8bc5d8afd7abd64ad5e9445b68ab1e3bc9 /activesupport
parent550b5e0824cc1cbbe21a1554d1b3f347af08dd30 (diff)
parentca9ac310028d0009edf1fbf657541d2dea327535 (diff)
downloadrails-c7ee244644903da5045c54f72e25a8ee6eb3bd68.tar.gz
rails-c7ee244644903da5045c54f72e25a8ee6eb3bd68.tar.bz2
rails-c7ee244644903da5045c54f72e25a8ee6eb3bd68.zip
Merge pull request #28831 from kamipo/respond_to_missing_should_be_private
`respond_to_missing?` should be private
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/duration.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb
index 99080e34a1..d4424ed792 100644
--- a/activesupport/lib/active_support/duration.rb
+++ b/activesupport/lib/active_support/duration.rb
@@ -305,10 +305,6 @@ module ActiveSupport
to_i
end
- def respond_to_missing?(method, include_private = false) #:nodoc:
- @value.respond_to?(method, include_private)
- end
-
# Build ISO 8601 Duration string for this duration.
# The +precision+ parameter can be used to limit seconds' precision of duration.
def iso8601(precision: nil)
@@ -335,8 +331,12 @@ module ActiveSupport
end
end
+ def respond_to_missing?(method, _)
+ value.respond_to?(method)
+ end
+
def method_missing(method, *args, &block)
- value.send(method, *args, &block)
+ value.public_send(method, *args, &block)
end
def raise_type_error(other)