Implement Key.authenticate
This commit is contained in:
@@ -4,4 +4,10 @@ class Key < ActiveRecord::Base
|
||||
has_secure_token :token
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
class << self
|
||||
def authenticate token
|
||||
find_by_token token
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user