Prevent exception when fetching current user
This commit is contained in:
parent
98764eb5be
commit
4a015d461a
@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def current_user
|
def current_user
|
||||||
@current_user ||= User.find(session[:user_id]) if session[:user_id]
|
@current_user ||= User.find_by(id: session[:user_id]) if session[:user_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user