Contributed projects either have user pushes or created MRs.
This commit is contained in:
parent
1bf9fa8c7f
commit
5179c5830b
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue