Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzenati <zenati@informatique.univ-paris-diderot.fr>2015-06-09 14:28:11 +0300
committerzenati <zenati@informatique.univ-paris-diderot.fr>2015-06-09 14:42:01 +0300
commitb0de6e9ae27a6364819f47d13d827a8aa253c83e (patch)
treea6d647652acd7c6e878cbd246488384f792c251a /app/models/user.rb
parent9562f028594c6d61834d48f75f8379b0de2ba8ae (diff)
An `in_namespace` scope is already present
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 596dc7ea33a..8be0b622704 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -352,9 +352,11 @@ class User < ActiveRecord::Base
end
def owned_projects
- @owned_projects ||= begin
- Project.where(namespace_id: owned_groups.pluck(:id).push(namespace.id)).joins(:namespace)
- end
+ @owned_projects ||=
+ begin
+ namespace_ids = owned_groups.pluck(:id).push(namespace.id)
+ Project.in_namespace(namespace_ids).joins(:namespace)
+ end
end
# Team membership in authorized projects