1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #41369 from aweglteo/remove-check-defined-bind_call

Remove check for UnboundMethod#method_defined? bind_call
This commit is contained in:
Ryuta Kamizono 2021-02-08 16:47:53 +09:00 committed by GitHub
commit 25af5e9ff8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,13 +53,7 @@ class NameError
UNBOUND_METHOD_MODULE_NAME = Module.instance_method(:name)
private_constant :UNBOUND_METHOD_MODULE_NAME
if UnboundMethod.method_defined?(:bind_call)
def real_mod_name(mod)
UNBOUND_METHOD_MODULE_NAME.bind_call(mod)
end
else
def real_mod_name(mod)
UNBOUND_METHOD_MODULE_NAME.bind(mod).call
end
def real_mod_name(mod)
UNBOUND_METHOD_MODULE_NAME.bind_call(mod)
end
end