summaryrefslogtreecommitdiff
path: root/app/models/release_highlight.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/models/release_highlight.rb
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
downloadgitlab-ce-a36f25615e8226344d87b692ccf3e543d5d81712.tar.gz
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/models/release_highlight.rb')
-rw-r--r--app/models/release_highlight.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/release_highlight.rb b/app/models/release_highlight.rb
index c2d498ecb13..7cead8a42cd 100644
--- a/app/models/release_highlight.rb
+++ b/app/models/release_highlight.rb
@@ -2,7 +2,6 @@
class ReleaseHighlight
CACHE_DURATION = 1.hour
- FILES_PATH = Rails.root.join('data', 'whats_new', '*.yml')
FREE_PACKAGE = 'Free'
PREMIUM_PACKAGE = 'Premium'
@@ -48,13 +47,17 @@ class ReleaseHighlight
nil
end
+ def self.whats_new_path
+ Rails.root.join('data/whats_new/*.yml')
+ end
+
def self.file_paths
@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) }
+ Dir.glob(whats_new_path).sort.reverse.map { |path| path.delete_prefix(Rails.root.to_s) }
end
end
@@ -119,3 +122,5 @@ class ReleaseHighlight
item['available_in']&.include?(current_package)
end
end
+
+ReleaseHighlight.prepend_mod