diff options
-rw-r--r-- | app/views/request/_correspondence.rhtml | 14 | ||||
-rw-r--r-- | config/environment.rb | 1 | ||||
-rwxr-xr-x | script/clear-incoming-text-cache | 1 |
3 files changed, 15 insertions, 1 deletions
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml index d5edd1e4b..f7e6870e0 100644 --- a/app/views/request/_correspondence.rhtml +++ b/app/views/request/_correspondence.rhtml @@ -2,7 +2,16 @@ if !info_request_event.nil? && info_request_event.event_type == 'response' incoming_message = info_request_event.incoming_message end - + +# cache against all the parameters that there are to this partial +cache_name = "correspondence/" + info_request_event.id.to_s +if !incoming_message.nil? + cache_name = cache_name + "/incoming_message/" + incoming_message.id.to_s +end +# yeuch, must be nicer way of telling cache just to use this cache_name, than +# putting it falsely in list action +cache(:controller => 'request', :action => 'list', :extra => cache_name) do + if not incoming_message.nil? %> <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>"> @@ -75,3 +84,6 @@ elsif info_request_event.event_type == 'sent' || info_request_event.event_type = end %> + +<% end %> + diff --git a/config/environment.rb b/config/environment.rb index d66f8ebfc..6d8606155 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -82,6 +82,7 @@ ActiveRecord::Errors.default_error_messages[:blank] = "must be filled in" ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| %(<span class="fieldWithErrors">#{html_tag}</span>)} # Include your application configuration below +ActionController::Base.cache_store = :file_store, File.join(File.dirname(__FILE__), '../cache') # Monkeypatch! Output HTML 4.0 compliant code, using method described in this # ticket: http://dev.rubyonrails.org/ticket/6009 diff --git a/script/clear-incoming-text-cache b/script/clear-incoming-text-cache index 66d640aa6..d03991341 100755 --- a/script/clear-incoming-text-cache +++ b/script/clear-incoming-text-cache @@ -8,4 +8,5 @@ $LOC/runner "ActiveRecord::Base.connection.execute(\"update incoming_messages se # Remove page caches rm -fr $LOC/../public/request +rm -fr $LOC/../cache |