Skip to content
Snippets Groups Projects
Commit a37132c9 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

move method

parent 0b953b50
No related branches found
No related tags found
No related merge requests found
......@@ -69,21 +69,6 @@ module Communication::Website::WithConnectedObjects
University::Organization.where(id: ids)
end
# Synchronisation optimale d'objet indirect
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.
end
git_repository.sync!
end
handle_asynchronously :sync_indirect_object_with_git, queue: 'default'
# ensure the object "website" respond to both is_direct_object? and is_indirect_object? as website doesn't include neither as_direct_object nor as_indirect_object
def is_direct_object?
true
......
......@@ -13,6 +13,21 @@ module Communication::Website::WithGitRepository
@git_repository ||= Git::Repository.new self
end
# Synchronisation optimale d'objet indirect
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.
end
git_repository.sync!
end
handle_asynchronously :sync_indirect_object_with_git, queue: 'default'
# Supprimer tous les git_files qui ne sont pas dans les recursive_dependencies_syncable
def destroy_obsolete_git_files
website_git_files.find_each do |git_file|
......
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