diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-18 18:27:11 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-18 18:27:11 +0300 |
commit | b46b52af37fd8c800e8fdca5de25be31415c7d5d (patch) | |
tree | 66b91d248160b6e50b57525b501b673430193641 /app/models | |
parent | aa47d99bdda5a460346db1970ced0da169036de4 (diff) | |
parent | 2505fb7b656815f3099ba2d34b447b254d8ec37e (diff) |
Merge branch 'mk-fix-issue-1843' into 'master'
Fix root groups redirecting to group owner
Closes #32474
See merge request !11465
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/namespace.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index a7ede5e3b9e..4d59267f71d 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -46,7 +46,7 @@ class Namespace < ActiveRecord::Base before_destroy(prepend: true) { prepare_for_destroy } after_destroy :rm_dir - scope :root, -> { where('type IS NULL') } + scope :for_user, -> { where('type IS NULL') } scope :with_statistics, -> do joins('LEFT JOIN project_statistics ps ON ps.namespace_id = namespaces.id') diff --git a/app/models/user.rb b/app/models/user.rb index 088a7cb83d5..d63641891fd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -350,7 +350,7 @@ class User < ActiveRecord::Base end def find_by_full_path(path, follow_redirects: false) - namespace = Namespace.find_by_full_path(path, follow_redirects: follow_redirects) + namespace = Namespace.for_user.find_by_full_path(path, follow_redirects: follow_redirects) namespace&.owner end |