提交 48e9ff75 编写于 作者: X Xavier Noria

Merge pull request #10207 from epiclabs/use_define_singleton_method

use define_singleton_method instead of class_eval
......@@ -36,10 +36,8 @@ module PerThreadRegistry
def method_missing(name, *args, &block) # :nodoc:
# Caches the method definition as a singleton method of the receiver.
singleton_class.class_eval do
define_method(name) do |*a, &b|
per_thread_registry_instance.public_send(name, *a, &b)
end
define_singleton_method(name) do |*a, &b|
per_thread_registry_instance.public_send(name, *a, &b)
end
send(name, *args, &block)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册