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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-22 23:55:00 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-22 23:55:00 +0300
commit43afe46bbd19b1edf60abf3f104fb2b0d29af564 (patch)
treee2a11249408e3403a5a125c50008e77ba1157e57 /app/models/user.rb
parent20a12438ab470afe1a5736fc46091a6ef4c30073 (diff)
Refactor contributions events and write tests for calendar
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index ba325132df8..50f664a09a3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -603,13 +603,10 @@ class User < ActiveRecord::Base
end
def contributed_projects_ids
- Event.where(author_id: self).
+ Event.contributions.where(author_id: self).
where("created_at > ?", Time.now - 1.year).
- where("action = :pushed OR (target_type = 'MergeRequest' AND action = :created)",
- pushed: Event::PUSHED, created: Event::CREATED).
reorder(project_id: :desc).
select(:project_id).
- uniq
- .map(&:project_id)
+ uniq.map(&:project_id)
end
end