aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-27 09:36:02 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-27 09:36:02 +0000
commit347a24ccfe0881b494044778cae64809d3e001c0 (patch)
treed9cc2cad0d41804fa8c43dfc5189a27d454fae14 /app/controllers/application_controller.rb
parent5d77eb0b4580bf6fb13e2fca2e9469b84f8315ff (diff)
More test data and a new test
This is a test for what I thought issue #370 might be. However this test is passing, so it isn’t that.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8fc6c3792..5a295d3e7 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -178,14 +178,13 @@ class ApplicationController < ActionController::Base
end
def foi_fragment_cache_path(param)
- path = foi_fragment_cache_part_path(param)
- path = "/views" + path
- foi_cache_path = File.join(File.dirname(__FILE__), '../../cache')
+ path = File.join(RAILS_ROOT, 'cache', 'views', foi_fragment_cache_part_path(param))
max_file_length = 255 - 35 # we subtract 35 because tempfile
# adds on a variable number of
# characters
- return File.join(foi_cache_path, path)[0...max_file_length]
+ return File.join(File.split(path).map{|x| x[0...max_file_length]})
end
+
def foi_fragment_cache_all_for_request(info_request)
# return stub path so admin can expire it
first_three_digits = info_request.id.to_s()[0..2]