From e7ac387466474681ffbf971cfaa2fca799f6d995 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 15 Mar 2012 18:10:10 +0600 Subject: [PATCH] [refs #265] fixed check rails env --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index f0e6bc84d..eb41ea381 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -262,7 +262,7 @@ class Project < ActiveRecord::Base end def write_hook - is_production = ENV['RAILS_ENV'] == 'production' + is_production = Rails.env == "production" hook = File.join(::Rails.root.to_s, 'tmp', "post-receive-hook") FileUtils.cp(File.join(::Rails.root.to_s, 'bin', "post-receive-hook.partial"), hook) File.open(hook, 'a') do |f|