diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-01-24 10:36:38 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-01-24 10:36:38 +0000 |
commit | 1445541f487fe22ec44b71607be3300319338d0a (patch) | |
tree | 5c9ed659c968f092317de6bab59a712e2584ca66 /app/controllers/request_controller.rb | |
parent | 4eb8432dedc8b521086cdf163ebe5d373396d39a (diff) | |
parent | b0a939a4d44077b4602176042ff4432b790561ad (diff) |
Merge branch 'release/0.16'0.16
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 388473b51..d982bd391 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -92,15 +92,8 @@ class RequestController < ApplicationController # Sidebar stuff @sidebar = true - # ... requests that have similar imporant terms - begin - limit = 10 - @xapian_similar = ActsAsXapian::Similar.new([InfoRequestEvent], @info_request.info_request_events, - :limit => limit, :collapse_by_prefix => 'request_collapse') - @xapian_similar_more = (@xapian_similar.matches_estimated > limit) - rescue - @xapian_similar = nil - end + @similar_cache_key = cache_key_for_similar_requests(@info_request, @locale) + # Track corresponding to this page @track_thing = TrackThing.create_track_for_request(@info_request) @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ] @@ -965,11 +958,17 @@ class RequestController < ApplicationController end if !done file_info = { :filename => 'correspondence.txt', - :data => render_to_string(:template => 'request/show.text', - :layout => false) } + :data => render_to_string(:template => 'request/show', + :layout => false, + :formats => [:text]) } end file_info end + def cache_key_for_similar_requests(info_request, locale) + "request/similar/#{info_request.id}/#{locale}" + end + + end |