Skip to content
Snippets Groups Projects
Commit a6e44c96 authored by Arnaud Levy's avatar Arnaud Levy
Browse files
parent a37132c9
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,7 @@ module Communication::Website::WithGitRepository
def sync_indirect_object_with_git(indirect_object)
return unless git_repository.valid?
indirect_object.direct_sources.each do |direct_source|
next unless direct_source.syncable?
Communication::Website::GitFile.sync self, direct_source
direct_source.recursive_dependencies(syncable_only: true).each do |object|
Communication::Website::GitFile.sync self, object
end
# On ne synchronise pas les références de l'objet direct, car on ne le modifie pas lui.
add_direct_source_to_sync(direct_source)
end
git_repository.sync!
end
......@@ -52,4 +47,15 @@ module Communication::Website::WithGitRepository
# Clean website if about was present and changed OR a language was removed
(saved_change_to_about_id? && about_id_before_last_save.present?) || language_was_removed
end
protected
def add_direct_source_to_sync(direct_source)
return unless direct_source.syncable?
Communication::Website::GitFile.sync self, direct_source
direct_source.recursive_dependencies(syncable_only: true).each do |object|
Communication::Website::GitFile.sync self, object
end
# On ne synchronise pas les références de l'objet direct, car on ne le modifie pas lui.
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment