diff options
Diffstat (limited to 'app/models/event.rb')
-rw-r--r-- | app/models/event.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index d6d39473774..8d93a228494 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -47,10 +47,10 @@ class Event < ActiveRecord::Base belongs_to :author, class_name: "User" belongs_to :project - belongs_to :target, polymorphic: true + belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations # For Hash only - serialize :data # rubocop:disable Cop/ActiverecordSerialize + serialize :data # rubocop:disable Cop/ActiveRecordSerialize # Callbacks after_create :reset_project_activity @@ -376,9 +376,9 @@ class Event < ActiveRecord::Base # At this point it's possible for multiple threads/processes to try to # 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). - update_all(last_activity_at: created_at) + Project.unscoped.where(id: project_id) + .where('last_activity_at <= ?', RESET_PROJECT_ACTIVITY_INTERVAL.ago) + .update_all(last_activity_at: created_at) end def authored_by?(user) @@ -392,7 +392,7 @@ class Event < ActiveRecord::Base end def set_last_repository_updated_at - Project.unscoped.where(id: project_id). - update_all(last_repository_updated_at: created_at) + Project.unscoped.where(id: project_id) + .update_all(last_repository_updated_at: created_at) end end |