aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/templates/rescues
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-05-05 00:42:12 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-05-05 00:49:53 -0700
commitacb39848ae4cfe1d22cd8a83c5db636d80c22b47 (patch)
tree30e6f833328772f2945b56febc1b04cde531e95a /actionpack/lib/action_dispatch/middleware/templates/rescues
parentd6e2c81cfe31a4c05adc50cd49fa265c5d3cd3e6 (diff)
downloadrails-acb39848ae4cfe1d22cd8a83c5db636d80c22b47.tar.gz
rails-acb39848ae4cfe1d22cd8a83c5db636d80c22b47.tar.bz2
rails-acb39848ae4cfe1d22cd8a83c5db636d80c22b47.zip
Try to convert object passed to debug_hash to hash
SessionStore was recently changed to delegate to hash object instead of inherit from it. Since we don't want to extend SessionStore with every method implemented in Hash, it's better to just convert any object passed to debug_hash (which is also better as we don't require to pass Hash instance there, it can be any object that can be converted to Hash).
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/templates/rescues')
-rw-r--r--actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb4
1 files changed, 2 insertions, 2 deletions
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 0c5bafa666..823f5d25b6 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
@@ -12,8 +12,8 @@
request_dump = clean_params.empty? ? 'None' : clean_params.inspect.gsub(',', ",\n")
- def debug_hash(hash)
- hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n")
+ def debug_hash(object)
+ object.to_hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n")
end unless self.class.method_defined?(:debug_hash)
%>