diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/info_request.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 46c247fa9..f6c377639 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -965,6 +965,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? !is_external? && awaiting_description && url_title != 'holding_pen' && get_last_response_event && Time.now > get_last_response_event.created_at + OLD_AGE_IN_DAYS |