Commit a7be3dfa30a452b307d1fdc0b4157ecbe908da8d
1 parent
772f2f1a
Exists in
spb-stable
and in
2 other branches
Remove set of thread variables
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
1 additions
and
34 deletions
Show diff stats
app/controllers/application_controller.rb
| ... | ... | @@ -4,7 +4,6 @@ class ApplicationController < 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 < 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 < 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