From 8eef083ccd59505b606e9733d38589cbd3d01fdf Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 12:09:25 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/personal_access_token.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models/personal_access_token.rb') diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb index 7afee2a35cb..1061e2bd0c6 100644 --- a/app/models/personal_access_token.rb +++ b/app/models/personal_access_token.rb @@ -22,6 +22,8 @@ class PersonalAccessToken < ApplicationRecord scope :inactive, -> { where("revoked = true OR expires_at < NOW()") } scope :with_impersonation, -> { where(impersonation: true) } scope :without_impersonation, -> { where(impersonation: false) } + scope :revoked, -> { where(revoked: true) } + scope :not_revoked, -> { where(revoked: [false, nil]) } scope :for_user, -> (user) { where(user: user) } scope :preload_users, -> { preload(:user) } scope :order_expires_at_asc, -> { reorder(expires_at: :asc) } -- cgit v1.2.1