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
75638b38
Commit
75638b38
authored
Apr 16, 2018
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dry up scopes
parent
e26af09f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
6 deletions
+20
-6
ee/app/models/concerns/object_storable.rb
ee/app/models/concerns/object_storable.rb
+8
-0
ee/app/models/geo/fdw/ci/job_artifact.rb
ee/app/models/geo/fdw/ci/job_artifact.rb
+4
-2
ee/app/models/geo/fdw/lfs_object.rb
ee/app/models/geo/fdw/lfs_object.rb
+4
-2
ee/app/models/geo/fdw/upload.rb
ee/app/models/geo/fdw/upload.rb
+4
-2
No files found.
ee/app/models/concerns/object_storable.rb
0 → 100644
View file @
75638b38
module
ObjectStorable
extend
ActiveSupport
::
Concern
included
do
scope
:with_files_stored_locally
,
->
{
where
(
self
::
STORE_COLUMN
=>
[
nil
,
ObjectStorage
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
self
::
STORE_COLUMN
=>
ObjectStorage
::
Store
::
REMOTE
)
}
end
end
ee/app/models/geo/fdw/ci/job_artifact.rb
View file @
75638b38
...
...
@@ -2,10 +2,12 @@ module Geo
module
Fdw
module
Ci
class
JobArtifact
<
::
Geo
::
BaseFdw
include
ObjectStorable
STORE_COLUMN
=
:file_store
self
.
table_name
=
Gitlab
::
Geo
::
Fdw
.
table
(
'ci_job_artifacts'
)
scope
:with_files_stored_locally
,
->
{
where
(
file_store:
[
nil
,
JobArtifactUploader
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
file_store:
JobArtifactUploader
::
Store
::
REMOTE
)
}
scope
:not_expired
,
->
{
where
(
'expire_at IS NULL OR expire_at > ?'
,
Time
.
current
)
}
scope
:geo_syncable
,
->
{
with_files_stored_locally
.
not_expired
}
end
...
...
ee/app/models/geo/fdw/lfs_object.rb
View file @
75638b38
module
Geo
module
Fdw
class
LfsObject
<
::
Geo
::
BaseFdw
include
ObjectStorable
STORE_COLUMN
=
:file_store
self
.
table_name
=
Gitlab
::
Geo
::
Fdw
.
table
(
'lfs_objects'
)
scope
:with_files_stored_locally
,
->
{
where
(
file_store:
[
nil
,
LfsObjectUploader
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
file_store:
LfsObjectUploader
::
Store
::
REMOTE
)
}
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
...
...
ee/app/models/geo/fdw/upload.rb
View file @
75638b38
module
Geo
module
Fdw
class
Upload
<
::
Geo
::
BaseFdw
include
ObjectStorable
STORE_COLUMN
=
:store
self
.
table_name
=
Gitlab
::
Geo
::
Fdw
.
table
(
'uploads'
)
scope
:with_files_stored_locally
,
->
{
where
(
store:
[
nil
,
ObjectStorage
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
store:
ObjectStorage
::
Store
::
REMOTE
)
}
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
...
...
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