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:
authorTimothy Andrew <mail@timothyandrew.net>2016-04-22 11:33:11 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-04-28 19:58:36 +0300
commitfc4bce755d19d570c4a00241048517c38aa839b3 (patch)
treef9b1c2b066d214f3b61aa4b2caae626d8715d7b6 /app/models/personal_access_token.rb
parent4076bce5d52b8a11eda48c36011666ea344ba3b7 (diff)
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.rb4
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)