summaryrefslogtreecommitdiff
path: root/app/models/personal_access_token.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-11-22 14:23:53 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-12-16 15:08:10 +0530
commit1d0ccec6dd8375b751846f69bb170ebd11e9a391 (patch)
treebe7f4331508c7cbcd1da679bfb0d3def05da5e2a /app/models/personal_access_token.rb
parent49a70d1e45b4f841379db059177856671c65159c (diff)
downloadgitlab-ce-1d0ccec6dd8375b751846f69bb170ebd11e9a391.tar.gz
Add a `scopes` column to the `personal_access_tokens` table
Diffstat (limited to 'app/models/personal_access_token.rb')
-rw-r--r--app/models/personal_access_token.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb
index c4b095e0c04..10a34c42fd8 100644
--- a/app/models/personal_access_token.rb
+++ b/app/models/personal_access_token.rb
@@ -2,6 +2,8 @@ class PersonalAccessToken < ActiveRecord::Base
include TokenAuthenticatable
add_authentication_token_field :token
+ serialize :scopes, Array
+
belongs_to :user
scope :active, -> { where(revoked: false).where("expires_at >= NOW() OR expires_at IS NULL") }