From 4e4bcae0841b81438ce3b6c627eebc7536566bf5 Mon Sep 17 00:00:00 2001
From: Kasper Timm Hansen <kaspth@gmail.com>
Date: Sat, 6 Feb 2016 22:28:59 +0100
Subject: Avoid coupling Action Pack to Railties.

Referencing Rails.env without checking if it's defined couples
us to Railties.

Fix by avoiding the line breaks if we don't have an env check
to rely on.
---
 actionpack/lib/action_controller/log_subscriber.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'actionpack')

diff --git a/actionpack/lib/action_controller/log_subscriber.rb b/actionpack/lib/action_controller/log_subscriber.rb
index d1d6acac26..450a04779f 100644
--- a/actionpack/lib/action_controller/log_subscriber.rb
+++ b/actionpack/lib/action_controller/log_subscriber.rb
@@ -26,7 +26,7 @@ module ActionController
         end
         message = "Completed #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]} in #{event.duration.round}ms"
         message << " (#{additions.join(" | ".freeze)})" unless additions.blank?
-        message << "\n\n" if Rails.env.development?
+        message << "\n\n" if defined?(Rails.env) && Rails.env.development?
 
         message
       end
-- 
cgit v1.2.3