Commit 70649515 authored by Krasimir Angelov's avatar Krasimir Angelov

Lookup namespace by pages host using find_by_path

In `Namespace#find_by_pages_host` we always have top level namespaces
which means we can use `find_by_path` instead of `find_by_full_path` and
avoid join on `routes`.

Related to https://gitlab.com/gitlab-org/gitlab/issues/207096.
parent fcbaaaff
......@@ -129,7 +129,7 @@ class Namespace < ApplicationRecord
return unless host.ends_with?(gitlab_host)
name = host.delete_suffix(gitlab_host)
Namespace.find_by_full_path(name)
Namespace.find_by_path(name)
end
# overridden in ee
......
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