diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-04-15 13:06:44 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-04-28 22:28:36 +0530 |
commit | 3a609038748055a27c7e01cf4b55d8249709c9cc (patch) | |
tree | b6ec5626549f2c423b958b8ebc3c08061388a4ca /app/models/personal_access_token.rb | |
parent | 973b948b9e9553a57113983fa4e32207b581e0ad (diff) | |
download | gitlab-ce-3a609038748055a27c7e01cf4b55d8249709c9cc.tar.gz |
Allow creating Personal Access Tokens through the website.
Diffstat (limited to 'app/models/personal_access_token.rb')
-rw-r--r-- | app/models/personal_access_token.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb new file mode 100644 index 00000000000..29f2275475f --- /dev/null +++ b/app/models/personal_access_token.rb @@ -0,0 +1,9 @@ +class PersonalAccessToken < ActiveRecord::Base + belongs_to :user + + def self.generate(params) + personal_access_token = self.new(params) + personal_access_token.token = Devise.friendly_token(50) + personal_access_token + end +end |