提交 5ced275a 编写于 作者: E Emilio Tagua

Remove old method before redefining it.

上级 5d773f8d
......@@ -161,6 +161,7 @@ def define_hash_access(route, name, kind, options)
# We use module_eval to avoid leaks
@module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1
remove_method :#{selector} if method_defined?(:#{selector})
def #{selector}(*args)
options = args.extract_options!
......@@ -194,6 +195,7 @@ def define_url_helper(route, name, kind, options)
hash_access_method = hash_access_name(name, kind)
@module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1
remove_method :#{selector} if method_defined?(:#{selector})
def #{selector}(*args)
url_for(#{hash_access_method}(*args))
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册