From 0ed803476ba01f08da6df8d1769fed254f3b2cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= Date: Mon, 27 May 2024 18:32:50 +0200 Subject: [PATCH] no component in array of dependencies (#1934) --- app/models/concerns/with_dependencies.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/with_dependencies.rb b/app/models/concerns/with_dependencies.rb index e1b06c07f..80df325da 100644 --- a/app/models/concerns/with_dependencies.rb +++ b/app/models/concerns/with_dependencies.rb @@ -84,7 +84,7 @@ def recursive_dependencies_add(array, dependency, syncable_only, follow_direct) # Si l'objet ne doit pas être ajouté on n'ajoute pas non plus ses dépendances récursives # C'est le fait de couper ici qui évite la boucle infinie return array unless dependency_should_be_added?(array, dependency, syncable_only) - array << dependency + array << dependency if dependency.is_a?(ActiveRecord::Base) return array if !follow_direct && dependency.try(:is_direct_object?) return array unless dependency.respond_to?(:recursive_dependencies) dependency.recursive_dependencies(array: array, syncable_only: syncable_only, follow_direct: follow_direct)