From 6286b63f27b6b36b9603c4c68600f8f352b84137 Mon Sep 17 00:00:00 2001
From: Emilio Tagua
Date: Tue, 28 Sep 2010 16:20:48 -0300
Subject: Remove warings from rescues: don't define more than once debug_hash
method and ask if @response if defined.
---
.../middleware/templates/rescues/_request_and_response.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'actionpack/lib/action_dispatch')
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
index e963b04524..97f7cf0bbe 100644
--- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
+++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
@@ -14,7 +14,7 @@
def debug_hash(hash)
hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n")
- end
+ end unless self.class.method_defined?(:debug_hash)
%>
Request
@@ -28,4 +28,4 @@
Response
-Headers:
<%=h @response ? @response.headers.inspect.gsub(',', ",\n") : 'None' %>
+Headers:
<%=h defined?(@response) ? @response.headers.inspect.gsub(',', ",\n") : 'None' %>
--
cgit v1.2.3