diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-04-22 14:03:11 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-04-28 22:28:36 +0530 |
commit | fc4bce755d19d570c4a00241048517c38aa839b3 (patch) | |
tree | f9b1c2b066d214f3b61aa4b2caae626d8715d7b6 /app/models/personal_access_token.rb | |
parent | 4076bce5d52b8a11eda48c36011666ea344ba3b7 (diff) | |
download | gitlab-ce-fc4bce755d19d570c4a00241048517c38aa839b3.tar.gz |
Make fixes based on @vsizov's comments on MR !3749
Diffstat (limited to 'app/models/personal_access_token.rb')
-rw-r--r-- | app/models/personal_access_token.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb index fff3f76fb93..c7c3932ba40 100644 --- a/app/models/personal_access_token.rb +++ b/app/models/personal_access_token.rb @@ -1,8 +1,8 @@ class PersonalAccessToken < ActiveRecord::Base belongs_to :user - scope :active, -> { where(revoked: false).where("expires_at >= :current OR expires_at IS NULL", current: Time.current) } - scope :inactive, -> { where("revoked = true OR expires_at < :current", current: Time.current) } + scope :active, -> { where(revoked: false).where("expires_at >= NOW() OR expires_at IS NULL") } + scope :inactive, -> { where("revoked = true OR expires_at < NOW()") } def self.generate(params) personal_access_token = self.new(params) |