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 4 before_filter :authenticate_user!
5 5 before_filter :reject_blocked!
6 6 before_filter :check_password_expiration
7   - around_filter :set_current_user_for_thread
8 7 before_filter :add_abilities
9 8 before_filter :ldap_security_check
10 9 before_filter :dev_tools if Rails.env == 'development'
... ... @@ -53,15 +52,6 @@ class ApplicationController &lt; ActionController::Base
53 52 end
54 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 55 def abilities
66 56 @abilities ||= Six.new
67 57 end
... ...
app/observers/base_observer.rb
... ... @@ -10,12 +10,4 @@ class BaseObserver &lt; ActiveRecord::Observer
10 10 def log_info message
11 11 Gitlab::AppLogger.info message
12 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 13 end
... ...
lib/api/helpers.rb
... ... @@ -36,16 +36,6 @@ module API
36 36 end
37 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 39 def user_project
50 40 @project ||= find_project(params[:id])
51 41 @project || not_found!
... ...
lib/gitlab/seeder.rb
... ... @@ -9,12 +9,7 @@ module Gitlab
9 9 end
10 10  
11 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 13 end
19 14  
20 15 def self.mute_mailer
... ...