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

Remove check for UnboundMethod#method_defined? bind_call

Rails 7.0 requires Ruby 2.7+ now so these checks should't be needed.
This commit is contained in:
aweglteo 2021-02-08 16:12:17 +09:00
parent b1f1879a50
commit 74b16dfe4f

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