From 6b25b4425cf29265c7a49363edb6b6bcd0d9d0eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Mon, 5 Dec 2022 17:10:17 +0100
Subject: [PATCH] cc

---
 .../communication/website/page/with_kind.rb   | 27 +++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/app/models/communication/website/page/with_kind.rb b/app/models/communication/website/page/with_kind.rb
index c5f491dc7..a504be139 100644
--- a/app/models/communication/website/page/with_kind.rb
+++ b/app/models/communication/website/page/with_kind.rb
@@ -52,18 +52,23 @@ module Communication::Website::Page::WithKind
 
     def special_page_git_dependencies(website)
       dependencies = [website.config_permalinks]
-      dependencies += [
-        website.categories,
-        website.authors.map(&:author),
-        website.posts
-      ].flatten if kind_communication_posts?
-      ['education_programs', 'education_diplomas', 'research_papers', 'organizations'].each do |kind|
-        dependencies += website.public_send(kind) if public_send("kind_#{kind}?")
-      end
-      dependencies += website.people_with_facets if kind_persons?
-      [:administrator, :author, :researcher, :teacher].each do |kind|
-        dependencies += website.public_send(kind.to_s.pluralize).map(&kind) if public_send("kind_#{kind.to_s.pluralize}?")
+      case kind
+      when "communication_posts"
+        dependencies += [
+          website.categories,
+          website.authors.map(&:author),
+          website.posts
+        ].flatten
+      when "education_programs", "education_diplomas", "research_papers", "organizations"
+        # dependencies += website.education_programs
+        dependencies += website.public_send(kind)
+      when "people"
+        dependencies += website.people_with_facets
+      when "administrators", "authors", "researchers", "teachers"
+        # dependencies += website.authors.map(&:author)
+        dependencies += website.public_send(kind).map(&kind.singularize.to_sym)
       end
+
       dependencies
     end
 
-- 
GitLab