Sha256: 264c5a8da4ba3f9cbbef7493cad87314f5757e273e59e793b9c4f1cf03c07ef8
Contents?: true
Size: 452 Bytes
Versions: 20
Compression:
Stored size: 452 Bytes
Contents
module Adminpanel module SessionsHelper def sign_in(user) cookies.permanent[:remember_token] = user.remember_token self.current_user = user end def signed_in? !current_user.nil? end def current_user=(user) @current_user = user end def current_user @current_user ||= User.find_by_remember_token(cookies[:remember_token]) end def sign_out self.current_user = nil cookies.delete(:remember_token) end end end
Version data entries
20 entries across 20 versions & 1 rubygems