diff options
author | Stan Hu <stanhu@gmail.com> | 2016-10-06 15:50:29 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-10-06 22:56:07 -0700 |
commit | 1662640985b56390a4d22dab1fee7fd04ccd5bc8 (patch) | |
tree | 82f19f1a7071d29a69f51c2f75e1acb3074dd0aa /app | |
parent | a625757cb469612409d47326241818ddf4fca982 (diff) | |
download | gitlab-ce-1662640985b56390a4d22dab1fee7fd04ccd5bc8.tar.gz |
Fix Event#reset_project_activity updatessh-fix-events-update-spec
!6678 removed the lease from Event#reset_project_activity, but it wasn't
actually updating the project's last_activity_at timestamp properly.
The WHERE clause would always return no matching projects. The spec
passed occasionally because the created_at timestamp was automatically
set to last_activity_at.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/event.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index 633019fe0af..314d5ba438f 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -335,7 +335,7 @@ class Event < ActiveRecord::Base # update the project. Only one query should actually perform the update, # hence we add the extra WHERE clause for last_activity_at. Project.unscoped.where(id: project_id). - where('last_activity_at > ?', RESET_PROJECT_ACTIVITY_INTERVAL.ago). + where('last_activity_at <= ?', RESET_PROJECT_ACTIVITY_INTERVAL.ago). update_all(last_activity_at: created_at) end |