diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-06 22:28:59 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-06 22:28:59 +0100 |
commit | 4e4bcae0841b81438ce3b6c627eebc7536566bf5 (patch) | |
tree | 7e420dd26b3d8f3c18ac11f27de4814c650a99b6 /actionpack/lib | |
parent | 495ec33d08f0535750fc4a08e1eee56ddc46137a (diff) | |
download | rails-4e4bcae0841b81438ce3b6c627eebc7536566bf5.tar.gz rails-4e4bcae0841b81438ce3b6c627eebc7536566bf5.tar.bz2 rails-4e4bcae0841b81438ce3b6c627eebc7536566bf5.zip |
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.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/log_subscriber.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |