Sha256: 1465c3396e61f52251d2b9363324b03da3af66ca5f02dacc4454160c484441a3
Contents?: true
Size: 477 Bytes
Versions: 10
Compression:
Stored size: 477 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
10 entries across 10 versions & 1 rubygems