diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-09-04 12:11:23 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-09-04 12:11:23 +0100 |
commit | ae29addfe3b4cd5ba6d6b04301f9d403c76089d8 (patch) | |
tree | b94bd0ef13075be5e55d0923c0a83a4922102827 /app/models | |
parent | 0b511943ef5a8835af34842291725d1dce74b25a (diff) |
Fix purging of non-default locale cached attachments0.18.0.13hotfix/0.18.0.13
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/info_request.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 47ad435cb..cd020c27c 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1038,6 +1038,19 @@ public File.join(Rails.root, "cache", "zips", "#{Rails.env}") end + def foi_fragment_cache_directories + # return stub path so admin can expire it + 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 first_three_digits = id.to_s()[0..2] File.join(first_three_digits.to_s, id.to_s) |