diff --git a/app/models/concerns/with_dependencies_synchronization.rb b/app/models/concerns/with_dependencies_synchronization.rb index bff5342f6dc9347efa14fa97289657d6ddf2fd21..0079e7fed836a8d264528c400b291323e5db6f53 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