提交 2117a535 编写于 作者: A Arthur Nogueira Neves

Merge pull request #21187 from arthurnn/method_missing_routes_av

Dont try to call method missing in routes if thats not what we want
......@@ -263,9 +263,15 @@ def _routes
end
def method_missing(selector, *args)
if @controller.respond_to?(:_routes) &&
( @controller._routes.named_routes.route_defined?(selector) ||
@controller._routes.mounted_helpers.method_defined?(selector) )
begin
routes = @controller.respond_to?(:_routes) && @controller._routes
rescue
# Dont call routes, if there is an error on _routes call
end
if routes &&
( routes.named_routes.route_defined?(selector) ||
routes.mounted_helpers.method_defined?(selector) )
@controller.__send__(selector, *args)
else
super
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册