From a73176b42ae71d0bbc6b4b3ba60d1e2e11eb857d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Fri, 12 May 2023 16:08:17 +0200
Subject: [PATCH] fix block dependencies on diplomas and categories

---
 app/models/communication/website/category.rb | 2 +-
 app/models/education/diploma.rb              | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/models/communication/website/category.rb b/app/models/communication/website/category.rb
index 614f44180..345efb0a9 100644
--- a/app/models/communication/website/category.rb
+++ b/app/models/communication/website/category.rb
@@ -96,7 +96,7 @@ class Communication::Website::Category < ApplicationRecord
   end
 
   def git_dependencies(website)
-    [self, parent].compact + siblings + descendants + active_storage_blobs + posts + website.menus
+    [self, parent].compact + siblings + descendants + git_block_dependencies + active_storage_blobs + posts + website.menus
   end
 
   def git_destroy_dependencies(website)
diff --git a/app/models/education/diploma.rb b/app/models/education/diploma.rb
index 7d78ab089..1c1b8da39 100644
--- a/app/models/education/diploma.rb
+++ b/app/models/education/diploma.rb
@@ -74,6 +74,7 @@ class Education::Diploma < ApplicationRecord
     website_programs = programs_for_website(website)
 
     dependencies = [self]
+    dependencies += git_block_dependencies
     dependencies += website_programs + website_programs.map(&:active_storage_blobs).flatten
     dependencies
   end
-- 
GitLab