diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/models/clusters/agents/activity_event.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/models/clusters/agents/activity_event.rb')
-rw-r--r-- | app/models/clusters/agents/activity_event.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/clusters/agents/activity_event.rb b/app/models/clusters/agents/activity_event.rb index 5d9c885c923..ec2bbfde339 100644 --- a/app/models/clusters/agents/activity_event.rb +++ b/app/models/clusters/agents/activity_event.rb @@ -3,6 +3,7 @@ module Clusters module Agents class ActivityEvent < ApplicationRecord + include EachBatch include NullifyIfBlank self.table_name = 'agent_activity_events' @@ -12,6 +13,7 @@ module Clusters belongs_to :agent_token, class_name: 'Clusters::AgentToken' scope :in_timeline_order, -> { order(recorded_at: :desc, id: :desc) } + scope :recorded_before, -> (cutoff) { where('recorded_at < ?', cutoff) } validates :recorded_at, :kind, :level, presence: true |