diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0373bf37..0f3f9a72 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base # check if there is a valid session and return the logged-in user (its object) if session[:user_id] and params[:foodcoop] # for shared-host installations. check if the cookie-subdomain fits to request. - @current_user ||= User.find(session[:user_id]) if params[:foodcoop] == Foodsoft.env + @current_user ||= User.find_by_id(session[:user_id]) if params[:foodcoop] == Foodsoft.env end end