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
3f772f02
Commit
3f772f02
authored
Dec 04, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring Geo::AttachmentRegistryFinder
parent
4c75a798
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
ee/app/finders/geo/attachment_registry_finder.rb
ee/app/finders/geo/attachment_registry_finder.rb
+8
-9
No files found.
ee/app/finders/geo/attachment_registry_finder.rb
View file @
3f772f02
...
...
@@ -43,20 +43,19 @@ module Geo
# FDW accessors
#
def
fdw_table
Geo
::
Fdw
::
Upload
.
table_name
end
def
fdw_find_synced_attachments
uploads
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_table
}
.id"
)
.
merge
(
Geo
::
FileRegistry
.
attachments
)
.
merge
(
Geo
::
FileRegistry
.
synced
)
fdw_find_attachments
.
merge
(
Geo
::
FileRegistry
.
synced
)
end
def
fdw_find_failed_attachments
fdw_find_attachments
.
merge
(
Geo
::
FileRegistry
.
failed
)
end
def
fdw_find_attachments
fdw_table
=
Geo
::
Fdw
::
Upload
.
table_name
uploads
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_table
}
.id"
)
.
merge
(
Geo
::
FileRegistry
.
attachments
)
.
merge
(
Geo
::
FileRegistry
.
failed
)
end
#
...
...
@@ -78,7 +77,7 @@ module Geo
INNER JOIN
(VALUES
#{
registry_file_ids
.
map
{
|
id
|
"(
#{
id
}
)"
}
.join(',')})
file_registry(file_id)
ON
uploads
.id = file_registry.file_id
ON
#{
Upload
.
table_name
}
.id = file_registry.file_id
SQL
joined_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