Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
a37132c9
Commit
a37132c9
authored
1 year ago
by
Arnaud Levy
Browse files
Options
Downloads
Patches
Plain Diff
move method
parent
0b953b50
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/communication/website/with_connected_objects.rb
+0
-15
0 additions, 15 deletions
app/models/communication/website/with_connected_objects.rb
app/models/communication/website/with_git_repository.rb
+15
-0
15 additions, 0 deletions
app/models/communication/website/with_git_repository.rb
with
15 additions
and
15 deletions
app/models/communication/website/with_connected_objects.rb
+
0
−
15
View file @
a37132c9
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
app/models/communication/website/with_git_repository.rb
+
15
−
0
View file @
a37132c9
...
...
@@ -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
|
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment