Commit 5179c583 authored by Douwe Maan's avatar Douwe Maan

Contributed projects either have user pushes or created MRs.

parent 1bf9fa8c
...@@ -618,9 +618,10 @@ class User < ActiveRecord::Base ...@@ -618,9 +618,10 @@ class User < ActiveRecord::Base
def contributed_projects_ids def contributed_projects_ids
Event.where(author_id: self). Event.where(author_id: self).
where("created_at > ?", Time.now - 1.year). 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). reorder(project_id: :desc).
select('DISTINCT(project_id)'). select(:project_id).
map(&:project_id) uniq
end end
end end
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