From bd927eea88a6b473ab6d9edb9aaa53b848775c79 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 5 Jul 2012 13:05:11 +0000 Subject: [PATCH] Perf: don't load preferences for the anonymous user. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9917 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 37d8b5f7c..5aac1d1fe 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -659,6 +659,10 @@ class AnonymousUser < User def time_zone; nil end def rss_key; nil end + def pref + UserPreference.new(:user => self) + end + # Anonymous user can not be destroyed def destroy false -- 2.39.5