diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 12:09:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 12:09:25 +0000 |
commit | 8eef083ccd59505b606e9733d38589cbd3d01fdf (patch) | |
tree | 72cc132b2bb3a60a8802d6af80c49953d7084afd /app/models/personal_access_token.rb | |
parent | e1d53af7ad463decf1df2944343c66b27512d4e1 (diff) | |
download | gitlab-ce-8eef083ccd59505b606e9733d38589cbd3d01fdf.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/personal_access_token.rb')
-rw-r--r-- | app/models/personal_access_token.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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) } |