summaryrefslogtreecommitdiff
path: root/app/models/release_highlight.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/release_highlight.rb')
-rw-r--r--app/models/release_highlight.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/release_highlight.rb b/app/models/release_highlight.rb
index 84e0a43670b..17a9ad7db66 100644
--- a/app/models/release_highlight.rb
+++ b/app/models/release_highlight.rb
@@ -49,8 +49,12 @@ class ReleaseHighlight
end
def self.file_paths
- @file_paths ||= Rails.cache.fetch(self.cache_key('file_paths'), expires_in: CACHE_DURATION) do
- Dir.glob(FILES_PATH).sort.reverse
+ @file_paths ||= self.relative_file_paths.map { |path| path.prepend(Rails.root.to_s) }
+ end
+
+ def self.relative_file_paths
+ Rails.cache.fetch(self.cache_key('file_paths'), expires_in: CACHE_DURATION) do
+ Dir.glob(FILES_PATH).sort.reverse.map { |path| path.delete_prefix(Rails.root.to_s) }
end
end