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:
authorAndreas Brandl <abrandl@gitlab.com>2018-02-23 22:33:16 +0300
committerAndreas Brandl <abrandl@gitlab.com>2018-03-06 14:53:12 +0300
commitebcf3c73bd515a4884961999ef7d33edaba93d57 (patch)
tree8733aa91c1716e681c6451f34138af4da3fb51be /app/models/event.rb
parentf88d5132c2c94407838e589e450f1b4167fd2629 (diff)
Track which projects a user contributed to.
Closes #43460.
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index 75538ba196c..f0cc99a9242 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -65,6 +65,7 @@ class Event < ActiveRecord::Base
# Callbacks
after_create :reset_project_activity
after_create :set_last_repository_updated_at, if: :push?
+ after_create :track_user_contributed_projects
# Scopes
scope :recent, -> { reorder(id: :desc) }
@@ -389,4 +390,8 @@ class Event < ActiveRecord::Base
Project.unscoped.where(id: project_id)
.update_all(last_repository_updated_at: created_at)
end
+
+ def track_user_contributed_projects
+ UserContributedProjects.track(self)
+ end
end