From 111fd6a8aa378a142aa0f8bda46f8dc4df92cbba Mon Sep 17 00:00:00 2001 From: Krekoten' Marjan Date: Tue, 21 Sep 2010 11:21:17 +0300 Subject: [PATCH] Fix logging when cache key contains % sign [#5570 state:resolved] --- actionpack/lib/action_controller/log_subscriber.rb | 2 +- actionpack/test/controller/log_subscriber_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_controller/log_subscriber.rb b/actionpack/lib/action_controller/log_subscriber.rb index ece270b..3b19310 100644 --- a/actionpack/lib/action_controller/log_subscriber.rb +++ b/actionpack/lib/action_controller/log_subscriber.rb @@ -42,7 +42,7 @@ module ActionController def #{method}(event) key_or_path = event.payload[:key] || event.payload[:path] human_name = #{method.to_s.humanize.inspect} - info("\#{human_name} \#{key_or_path} (%.1fms)" % event.duration) + info("\#{human_name} \#{key_or_path} \#{"(%.1fms)" % event.duration}") end METHOD end diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 414eec4..0b69084 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -21,11 +21,11 @@ module Another end def with_fragment_cache - render :inline => "<%= cache('foo'){ 'bar' } %>" + render :inline => "<%= cache('foo%bar'){ 'bar' } %>" end def with_page_cache - cache_page("Super soaker", "/index.html") + cache_page("Super soaker %100 :)", "/index.html") render :nothing => true end end -- 1.7.2