diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 00:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 00:09:15 +0300 |
commit | 9c918ae5c688cf492589be0c082956fd72aacea7 (patch) | |
tree | 21b7e3ef09c140c22491f2e583887fc2924c7f16 /app/models/key.rb | |
parent | 676109e1b32682bdbdd94a9ffbd8743784f35521 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/key.rb')
-rw-r--r-- | app/models/key.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index 18fa8aaaa16..d9da700376a 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -43,6 +43,7 @@ class Key < ApplicationRecord scope :preload_users, -> { preload(:user) } scope :for_user, -> (user) { where(user: user) } scope :order_last_used_at_desc, -> { reorder(::Gitlab::Database.nulls_last_order('last_used_at', 'DESC')) } + scope :expired_today_and_not_notified, -> { where(["date(expires_at AT TIME ZONE 'UTC') = CURRENT_DATE AND expiry_notification_delivered_at IS NULL"]) } def self.regular_keys where(type: ['Key', nil]) |