From a7be3dfa30a452b307d1fdc0b4157ecbe908da8d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 10 Jun 2014 17:51:49 +0300 Subject: Remove set of thread variables Signed-off-by: Dmitriy Zaporozhets --- lib/api/helpers.rb | 10 ---------- lib/gitlab/seeder.rb | 7 +------ 2 files changed, 1 insertion(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 654c1f62c6c..b6a5806d646 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -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! diff --git a/lib/gitlab/seeder.rb b/lib/gitlab/seeder.rb index 39de1223b18..31aa3528c4c 100644 --- a/lib/gitlab/seeder.rb +++ b/lib/gitlab/seeder.rb @@ -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 -- cgit v1.2.1