Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-01 00:09:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-01 00:09:15 +0300
commit9c918ae5c688cf492589be0c082956fd72aacea7 (patch)
tree21b7e3ef09c140c22491f2e583887fc2924c7f16 /app/models/key.rb
parent676109e1b32682bdbdd94a9ffbd8743784f35521 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/key.rb')
-rw-r--r--app/models/key.rb1
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])