diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-02 18:15:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-02 18:15:46 +0000 |
commit | 9507b448b2589ce821e8f215c57a1d5434f7d2e2 (patch) | |
tree | c9744bbda8d0cb08d6c368e6a8b7b4c9a1584eb2 | |
parent | e821020394a658ae979d55046c7f0138ea9cc659 (diff) | |
download | redmine-9507b448b2589ce821e8f215c57a1d5434f7d2e2.tar.gz redmine-9507b448b2589ce821e8f215c57a1d5434f7d2e2.zip |
Makes User.current thread safe (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10911 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 261487230..9a432fc2e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -601,11 +601,11 @@ class User < Principal end def self.current=(user) - @current_user = user + Thread.current[:current_user] = user end def self.current - @current_user ||= User.anonymous + Thread.current[:current_user] ||= User.anonymous end # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only |