diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-02-23 20:33:16 +0100 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-03-06 12:53:12 +0100 |
commit | ebcf3c73bd515a4884961999ef7d33edaba93d57 (patch) | |
tree | 8733aa91c1716e681c6451f34138af4da3fb51be /app/models/event.rb | |
parent | f88d5132c2c94407838e589e450f1b4167fd2629 (diff) | |
download | gitlab-ce-ebcf3c73bd515a4884961999ef7d33edaba93d57.tar.gz |
Track which projects a user contributed to.
Closes #43460.
Diffstat (limited to 'app/models/event.rb')
-rw-r--r-- | app/models/event.rb | 5 |
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 |