gitlab-org--gitlab-foss/app/helpers/external_wiki_helper.rb
Eugene Howe 13e74543f9 speed up ExternalWikiService#get_project_wiki_path
* This method previously iterated over all services in a project.  Now it
will directly query the ExternalWikiService for the project and filter
by active state.
* The presence of an external wiki is also cached
* When an external wiki is added or removed, the cached value is updated
2016-07-19 09:06:58 -04:00

10 lines
298 B
Ruby

module ExternalWikiHelper
def get_project_wiki_path(project)
external_wiki_service = project.external_wiki
if external_wiki_service
external_wiki_service.properties['external_wiki_url']
else
namespace_project_wiki_path(project.namespace, project, :home)
end
end
end