Allow user to creates named auth keys with token
This commit is contained in:
7
app/models/key.rb
Normal file
7
app/models/key.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Key < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
|
||||
has_secure_token :token
|
||||
|
||||
validates :name, presence: true
|
||||
end
|
@@ -4,6 +4,7 @@ class User < ActiveRecord::Base
|
||||
attr_reader :password
|
||||
|
||||
has_many :playlists
|
||||
has_many :keys
|
||||
|
||||
validates :email,
|
||||
presence: true,
|
||||
|
Reference in New Issue
Block a user