Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
30b5179c
Commit
30b5179c
authored
Jul 14, 2020
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix replicable attachments
parent
5313fb3f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
ee/app/models/concerns/geo/selective_sync.rb
ee/app/models/concerns/geo/selective_sync.rb
+18
-5
No files found.
ee/app/models/concerns/geo/selective_sync.rb
View file @
30b5179c
...
...
@@ -3,12 +3,9 @@
module
Geo::SelectiveSync
extend
ActiveSupport
::
Concern
# @return [ActiveRecord::Relation<Upload>] scope of everything that should be synced
def
attachments
if
selective_sync?
uploads_model
.
where
(
group_attachments
.
or
(
project_attachments
).
or
(
other_attachments
))
else
uploads_model
.
all
end
attachments_selective_sync_scope
.
merge
(
attachments_object_storage_scope
)
end
def
projects_outside_selected_namespaces
...
...
@@ -49,6 +46,22 @@ module Geo::SelectiveSync
private
# @return [ActiveRecord::Relation<Upload>] scope observing object storage settings
def
attachments_object_storage_scope
return
uploads_model
.
all
if
sync_object_storage?
uploads_model
.
with_files_stored_locally
end
# @return [ActiveRecord::Relation<Upload>] scope observing selective sync settings
def
attachments_selective_sync_scope
if
selective_sync?
uploads_model
.
where
(
group_attachments
.
or
(
project_attachments
).
or
(
other_attachments
))
else
uploads_model
.
all
end
end
def
selected_namespaces_and_descendants
relation
=
selected_namespaces_and_descendants_cte
.
apply_to
(
namespaces_model
.
all
)
read_only
(
relation
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment