From d1cc6c6f3b3ff27e9747d8d013d94d0a20b3cf27 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Mon, 24 Apr 2023 15:22:22 +0200 Subject: [PATCH] dependencies sync --- .../concerns/with_dependencies_synchronization.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/concerns/with_dependencies_synchronization.rb b/app/models/concerns/with_dependencies_synchronization.rb index bff5342f6..0079e7fed 100644 --- a/app/models/concerns/with_dependencies_synchronization.rb +++ b/app/models/concerns/with_dependencies_synchronization.rb @@ -9,10 +9,8 @@ module WithDependenciesSynchronization before_save :compute_dependencies_before_save after_save :cleanup_websites if :dependencies_missing_after_save? after_destroy :cleanup_websites - end - protected def compute_dependencies_before_save @@ -24,9 +22,11 @@ module WithDependenciesSynchronization end def cleanup_websites - # TODO + if is_direct_object? + website.destroy_obsolete_git_files + else + websites.each(&:destroy_obsolete_git_files) + end end - - -end \ No newline at end of file +end -- GitLab