summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-05 13:05:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-05 13:05:11 +0000
commitbd927eea88a6b473ab6d9edb9aaa53b848775c79 (patch)
tree23538538f3fc0b233306a349f052c87175957776 /app
parenta1f17b982c72dd790ff58c3262b4431dfadd3c9b (diff)
downloadredmine-bd927eea88a6b473ab6d9edb9aaa53b848775c79.tar.gz
redmine-bd927eea88a6b473ab6d9edb9aaa53b848775c79.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb4
1 files changed, 4 insertions, 0 deletions
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