Commit 7fee6289 authored by Francisco Javier López's avatar Francisco Javier López Committed by Dmitriy Zaporozhets

Fix route snippet helpers

parent b9ae6b69
...@@ -195,7 +195,7 @@ module GitlabRoutingHelper ...@@ -195,7 +195,7 @@ module GitlabRoutingHelper
end end
def snippet_path(snippet, *args) def snippet_path(snippet, *args)
if snippet.is_a?(ProjectSnippet) if snippet.type == "ProjectSnippet"
application_url_helpers.project_snippet_path(snippet.project, snippet, *args) application_url_helpers.project_snippet_path(snippet.project, snippet, *args)
else else
new_args = snippet_query_params(snippet, *args) new_args = snippet_query_params(snippet, *args)
...@@ -204,7 +204,7 @@ module GitlabRoutingHelper ...@@ -204,7 +204,7 @@ module GitlabRoutingHelper
end end
def snippet_url(snippet, *args) def snippet_url(snippet, *args)
if snippet.is_a?(ProjectSnippet) if snippet.type == "ProjectSnippet"
application_url_helpers.project_snippet_url(snippet.project, snippet, *args) application_url_helpers.project_snippet_url(snippet.project, snippet, *args)
else else
new_args = snippet_query_params(snippet, *args) new_args = snippet_query_params(snippet, *args)
...@@ -213,7 +213,7 @@ module GitlabRoutingHelper ...@@ -213,7 +213,7 @@ module GitlabRoutingHelper
end end
def raw_snippet_path(snippet, *args) def raw_snippet_path(snippet, *args)
if snippet.is_a?(ProjectSnippet) if snippet.type == "ProjectSnippet"
application_url_helpers.raw_project_snippet_path(snippet.project, snippet, *args) application_url_helpers.raw_project_snippet_path(snippet.project, snippet, *args)
else else
new_args = snippet_query_params(snippet, *args) new_args = snippet_query_params(snippet, *args)
...@@ -222,7 +222,7 @@ module GitlabRoutingHelper ...@@ -222,7 +222,7 @@ module GitlabRoutingHelper
end end
def raw_snippet_url(snippet, *args) def raw_snippet_url(snippet, *args)
if snippet.is_a?(ProjectSnippet) if snippet.type == "ProjectSnippet"
application_url_helpers.raw_project_snippet_url(snippet.project, snippet, *args) application_url_helpers.raw_project_snippet_url(snippet.project, snippet, *args)
else else
new_args = snippet_query_params(snippet, *args) new_args = snippet_query_params(snippet, *args)
......
---
title: Fix snippet routes
merge_request: 21248
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment