mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Routes from Engine Railties should not be an infinite loop
This commit is contained in:
parent
6060a1d97b
commit
b50f7ae627
2 changed files with 10 additions and 2 deletions
|
@ -444,8 +444,10 @@ module ActionDispatch
|
|||
end
|
||||
|
||||
def include_helpers_now(klass, include_path_helpers)
|
||||
if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_routes_url_helpers) }
|
||||
klass.include(namespace.railtie_routes_url_helpers(include_path_helpers))
|
||||
namespace = klass.parents.detect { |m| m.respond_to?(:railtie_include_helpers) }
|
||||
|
||||
if namespace && namespace.railtie_namespace.routes != self
|
||||
namespace.railtie_include_helpers(klass, include_path_helpers)
|
||||
else
|
||||
klass.include(url_helpers(include_path_helpers))
|
||||
end
|
||||
|
|
|
@ -403,6 +403,12 @@ module Rails
|
|||
define_method(:railtie_helpers_paths) { railtie.helpers_paths }
|
||||
end
|
||||
|
||||
unless mod.respond_to?(:railtie_include_helpers)
|
||||
define_method(:railtie_include_helpers) { |klass, include_path_helpers|
|
||||
railtie.routes.include_helpers(klass, include_path_helpers)
|
||||
}
|
||||
end
|
||||
|
||||
unless mod.respond_to?(:railtie_routes_url_helpers)
|
||||
define_method(:railtie_routes_url_helpers) { |include_path_helpers = true| railtie.routes.url_helpers(include_path_helpers) }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue