Allow user to creates named auth keys with token

This commit is contained in:
Thibault Jouan
2015-05-04 04:34:13 +00:00
parent 7d1274cbb3
commit 763c9789ec
12 changed files with 174 additions and 1 deletions

7
app/models/key.rb Normal file
View File

@@ -0,0 +1,7 @@
class Key < ActiveRecord::Base
belongs_to :user
has_secure_token :token
validates :name, presence: true
end

View File

@@ -4,6 +4,7 @@ class User < ActiveRecord::Base
attr_reader :password
has_many :playlists
has_many :keys
validates :email,
presence: true,