diff options
author | Reverite <github@reverite.sh> | 2019-06-27 21:10:01 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-06-27 21:10:01 -0700 |
commit | 9861df046853b71370cede86afbba1a371714756 (patch) | |
tree | 38416f38dfc2a2349b7a5df20646bb7d0f51361f /app/controllers/application_controller.rb | |
parent | 2d396aa3a0bf2674194b9f4c0e0a1052b8d23a06 (diff) | |
parent | ca17bae904783dfb1f4899a533d28a79da0c6fe9 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 333082f68..cef412554 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -161,11 +161,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_flavour |