add new files
This commit is contained in:
21
app/models/member.rb
Normal file
21
app/models/member.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class Member < ApplicationRecord
|
||||
# Include default devise modules. Others available are:
|
||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||
belongs_to :user,optional: true
|
||||
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable,:uid, :confirmable, :lockable
|
||||
|
||||
def self.authenticate_session_token(token)
|
||||
if token.nil? || token.blank? || token.to_s == ' '
|
||||
return false
|
||||
else
|
||||
mem = Member.find_by_session_token(token)
|
||||
if mem.nil?
|
||||
return false
|
||||
else
|
||||
return mem
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user