From acb39848ae4cfe1d22cd8a83c5db636d80c22b47 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sat, 5 May 2012 00:42:12 -0700 Subject: 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). --- .../middleware/templates/rescues/_request_and_response.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware/templates/rescues') 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) %> -- cgit v1.2.3