Skip to content
Snippets Groups Projects
Unverified Commit 68365871 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix unnecessary SQL query performed on unauthenticated requests (#11179)

parent 8d577956
No related branches found
No related tags found
No related merge requests found
......@@ -91,11 +91,15 @@ class ApplicationController < ActionController::Base
end
def current_account
@current_account ||= current_user.try(:account)
return @current_account if defined?(@current_account)
@current_account = current_user&.account
end
def current_session
@current_session ||= SessionActivation.find_by(session_id: cookies.signed['_session_id'])
return @current_session if defined?(@current_session)
@current_session = SessionActivation.find_by(session_id: cookies.signed['_session_id']) if cookies.signed['_session_id'].present?
end
def current_theme
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment