Load user memberships by default

since nearly every view will check permissions, eager loading memberships might
be a good idea.
pull/3/head
Gregor Schmidt 12 years ago committed by Martin Czuchra
parent ab968a52fc
commit eeb052280f
  1. 2
      app/controllers/application_controller.rb

@ -84,7 +84,7 @@ class ApplicationController < ActionController::Base
def find_current_user
if session[:user_id]
# existing session
(User.active.find(session[:user_id]) rescue nil)
(User.active.find(session[:user_id], :include => [:memberships]) rescue nil)
elsif cookies[Redmine::Configuration['autologin_cookie_name']] && Setting.autologin?
# auto-login feature starts a new session
user = User.try_to_autologin(cookies[Redmine::Configuration['autologin_cookie_name']])

Loading…
Cancel
Save