Commit a7be3dfa30a452b307d1fdc0b4157ecbe908da8d

Authored by Dmitriy Zaporozhets
1 parent 772f2f1a

Remove set of thread variables

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/controllers/application_controller.rb
@@ -4,7 +4,6 @@ class ApplicationController &lt; ActionController::Base @@ -4,7 +4,6 @@ class ApplicationController &lt; ActionController::Base
4 before_filter :authenticate_user! 4 before_filter :authenticate_user!
5 before_filter :reject_blocked! 5 before_filter :reject_blocked!
6 before_filter :check_password_expiration 6 before_filter :check_password_expiration
7 - around_filter :set_current_user_for_thread  
8 before_filter :add_abilities 7 before_filter :add_abilities
9 before_filter :ldap_security_check 8 before_filter :ldap_security_check
10 before_filter :dev_tools if Rails.env == 'development' 9 before_filter :dev_tools if Rails.env == 'development'
@@ -53,15 +52,6 @@ class ApplicationController &lt; ActionController::Base @@ -53,15 +52,6 @@ class ApplicationController &lt; ActionController::Base
53 end 52 end
54 end 53 end
55 54
56 - def set_current_user_for_thread  
57 - Thread.current[:current_user] = current_user  
58 - begin  
59 - yield  
60 - ensure  
61 - Thread.current[:current_user] = nil  
62 - end  
63 - end  
64 -  
65 def abilities 55 def abilities
66 @abilities ||= Six.new 56 @abilities ||= Six.new
67 end 57 end
app/observers/base_observer.rb
@@ -10,12 +10,4 @@ class BaseObserver &lt; ActiveRecord::Observer @@ -10,12 +10,4 @@ class BaseObserver &lt; ActiveRecord::Observer
10 def log_info message 10 def log_info message
11 Gitlab::AppLogger.info message 11 Gitlab::AppLogger.info message
12 end 12 end
13 -  
14 - def current_user  
15 - Thread.current[:current_user]  
16 - end  
17 -  
18 - def current_commit  
19 - Thread.current[:current_commit]  
20 - end  
21 end 13 end
lib/api/helpers.rb
@@ -36,16 +36,6 @@ module API @@ -36,16 +36,6 @@ module API
36 end 36 end
37 end 37 end
38 38
39 - def set_current_user_for_thread  
40 - Thread.current[:current_user] = current_user  
41 -  
42 - begin  
43 - yield  
44 - ensure  
45 - Thread.current[:current_user] = nil  
46 - end  
47 - end  
48 -  
49 def user_project 39 def user_project
50 @project ||= find_project(params[:id]) 40 @project ||= find_project(params[:id])
51 @project || not_found! 41 @project || not_found!
lib/gitlab/seeder.rb
@@ -9,12 +9,7 @@ module Gitlab @@ -9,12 +9,7 @@ module Gitlab
9 end 9 end
10 10
11 def self.by_user(user) 11 def self.by_user(user)
12 - begin  
13 - Thread.current[:current_user] = user  
14 - yield  
15 - ensure  
16 - Thread.current[:current_user] = nil  
17 - end 12 + yield
18 end 13 end
19 14
20 def self.mute_mailer 15 def self.mute_mailer