aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-09-04 11:55:59 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-04 11:55:59 +0100
commit558c6e8ef9d10517725f0c88cc7c63b00c2af0e9 (patch)
tree1898c7646daf3ccb35b68b3c5c5b65f6e556c9f8 /app/models
parent8d5c7b7c4efc09052031e6cab81a3539ae319f2f (diff)
Fix caching of non-default locale cached attachments0.7.0.7hotfix/0.7.0.7
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index cee9eb959..7e9761506 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -986,6 +986,24 @@ public
find(:all, params)
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)
+ end
+
def is_old_unclassified?
return false if is_external?
return false if !awaiting_description