]> source.dussan.org Git - redmine.git/commitdiff
Makes User.current thread safe (#12097).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Dec 2012 18:15:46 +0000 (18:15 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Dec 2012 18:15:46 +0000 (18:15 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10911 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index 2614872303bc9c2869f03a201ba3e18776d93bd8..9a432fc2e8a62740fc3fde4dc93d4eff9c2d8d03 100644 (file)
@@ -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