Use namespace as symbol in polymorphic_path calls
Our `namespace` helper returns a string. However, Rails version 5.2.4.6 doesn't allow strings as arguments to polymorphic_path [1] Since returning a symbol in our `namespace` helper would break other places in the application, we're converting it to a symbol in the methods calling `polymorphic_path`. [1] https://github.com/advisories/GHSA-hjg4-8q5f-x6fm
This commit is contained in:
@@ -30,9 +30,9 @@ module ActionDispatch::Routing::UrlFor
|
||||
resolve = resolve_for(resource)
|
||||
resolve_options = resolve.pop
|
||||
|
||||
polymorphic_path([namespace, *resolve], options.merge(resolve_options))
|
||||
polymorphic_path([namespace.to_sym, *resolve], options.merge(resolve_options))
|
||||
else
|
||||
polymorphic_path([namespace, *resource_hierarchy_for(resource)], options)
|
||||
polymorphic_path([namespace.to_sym, *resource_hierarchy_for(resource)], options)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user