summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/users_controller.rb4
-rw-r--r--app/models/user.rb7
2 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 4c2fe4c3c8d..8a13394dbac 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -6,7 +6,9 @@ class UsersController < ApplicationController
def show
@contributed_projects = Project.
where(id: authorized_projects_ids & @user.contributed_projects_ids).
- in_group_namespace.includes(:namespace)
+ in_group_namespace.
+ includes(:namespace).
+ reject(&:forked?)
@projects = @user.personal_projects.
where(id: authorized_projects_ids).includes(:namespace)
diff --git a/app/models/user.rb b/app/models/user.rb
index 08ad619a90c..a43493d15fb 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -623,9 +623,10 @@ class User < ActiveRecord::Base
def contributed_projects_ids
Event.where(author_id: self).
where("created_at > ?", Time.now - 1.year).
- code_push.
+ where("action = :pushed OR (target_type = 'MergeRequest' AND action = :created)",
+ pushed: Event::PUSHED, created: Event::CREATED).
reorder(project_id: :desc).
- select('DISTINCT(project_id)').
- map(&:project_id)
+ select(:project_id).
+ uniq
end
end