aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-09-01 10:34:08 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-01 11:19:53 +0100
commitbaf8be95fff5c00688af6f0fae72392600ee9254 (patch)
treeaf6b959b9266baa132c11537ba6b56be4a46b285 /app/models/info_request.rb
parent82565870dfa3b7da0a729723345097e230c4a163 (diff)
Return a list of all cache directories for the request
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 1d82a5714..d0052603a 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -1048,11 +1048,17 @@ public
File.join(Rails.root, "cache", "zips", "#{Rails.env}")
end
- def foi_fragment_cache_directory
+ def foi_fragment_cache_directories
# return stub path so admin can expire it
- path = "views/request/#{request_dirs}"
- foi_cache_path = File.expand_path(File.join(Rails.root, 'cache'))
- return File.join(foi_cache_path, path)
+ directories = []
+ path = File.join("request", request_dirs)
+ foi_cache_path = File.expand_path(File.join(Rails.root, 'cache', 'views'))
+ directories << File.join(foi_cache_path, path)
+ I18n.available_locales.each do |locale|
+ directories << File.join(foi_cache_path, locale.to_s, path)
+ end
+
+ directories
end
def request_dirs