Remove set of thread variables
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
772f2f1ac8
commit
a7be3dfa30
|
|
@ -4,7 +4,6 @@ class ApplicationController < ActionController::Base
|
|||
before_filter :authenticate_user!
|
||||
before_filter :reject_blocked!
|
||||
before_filter :check_password_expiration
|
||||
around_filter :set_current_user_for_thread
|
||||
before_filter :add_abilities
|
||||
before_filter :ldap_security_check
|
||||
before_filter :dev_tools if Rails.env == 'development'
|
||||
|
|
@ -53,15 +52,6 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
def set_current_user_for_thread
|
||||
Thread.current[:current_user] = current_user
|
||||
begin
|
||||
yield
|
||||
ensure
|
||||
Thread.current[:current_user] = nil
|
||||
end
|
||||
end
|
||||
|
||||
def abilities
|
||||
@abilities ||= Six.new
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,12 +10,4 @@ class BaseObserver < ActiveRecord::Observer
|
|||
def log_info message
|
||||
Gitlab::AppLogger.info message
|
||||
end
|
||||
|
||||
def current_user
|
||||
Thread.current[:current_user]
|
||||
end
|
||||
|
||||
def current_commit
|
||||
Thread.current[:current_commit]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -36,16 +36,6 @@ module API
|
|||
end
|
||||
end
|
||||
|
||||
def set_current_user_for_thread
|
||||
Thread.current[:current_user] = current_user
|
||||
|
||||
begin
|
||||
yield
|
||||
ensure
|
||||
Thread.current[:current_user] = nil
|
||||
end
|
||||
end
|
||||
|
||||
def user_project
|
||||
@project ||= find_project(params[:id])
|
||||
@project || not_found!
|
||||
|
|
|
|||
|
|
@ -9,12 +9,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def self.by_user(user)
|
||||
begin
|
||||
Thread.current[:current_user] = user
|
||||
yield
|
||||
ensure
|
||||
Thread.current[:current_user] = nil
|
||||
end
|
||||
yield
|
||||
end
|
||||
|
||||
def self.mute_mailer
|
||||
|
|
|
|||
Loading…
Reference in New Issue