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:
authorFelipe Artur <felipefac@gmail.com>2016-03-18 01:42:46 +0300
committerFelipe Artur <felipefac@gmail.com>2016-03-18 01:42:46 +0300
commit0a7f7161198feaa9a4cae7c16669a0e6187aed33 (patch)
tree445dcbd9f473be2af293a299b634525725a70666 /app/finders/contributed_projects_finder.rb
parenta18ac62756573a2da2c42ca50b6f30033be6fa63 (diff)
Code fixes
Diffstat (limited to 'app/finders/contributed_projects_finder.rb')
-rw-r--r--app/finders/contributed_projects_finder.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/finders/contributed_projects_finder.rb b/app/finders/contributed_projects_finder.rb
index 4f7fe1c748b..f8b04dfa2aa 100644
--- a/app/finders/contributed_projects_finder.rb
+++ b/app/finders/contributed_projects_finder.rb
@@ -10,8 +10,9 @@ class ContributedProjectsFinder
# visible by this user.
#
# Returns an ActiveRecord::Relation.
+
def execute(current_user = nil)
- if current_user && !current_user.external?
+ if current_user
relation = projects_visible_to_user(current_user)
else
relation = public_projects
@@ -24,9 +25,7 @@ class ContributedProjectsFinder
def projects_visible_to_user(current_user)
authorized = @user.contributed_projects.visible_to_user(current_user)
-
- union = Gitlab::SQL::Union.
- new([authorized.select(:id), public_projects.select(:id)])
+ union = Gitlab::SQL::Union.new([authorized.select(:id), public_projects.select(:id)])
Project.where("projects.id IN (#{union.to_sql})")
end