mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-09 05:15:53 +10:00
12 lines
194 B
Ruby
12 lines
194 B
Ruby
class AuthToken < ActiveRecord::Base
|
|
|
|
belongs_to :user
|
|
|
|
class << self
|
|
def generate_token_for user
|
|
AuthToken.create value: SecureRandom.hex(16), user_id: user.id
|
|
end
|
|
end
|
|
|
|
end
|