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
458bb965
Commit
458bb965
authored
Apr 29, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing relationships
parent
06493527
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
ee/app/models/geo/fdw/ci/job_artifact.rb
ee/app/models/geo/fdw/ci/job_artifact.rb
+2
-0
ee/app/models/geo/fdw/project.rb
ee/app/models/geo/fdw/project.rb
+1
-0
ee/spec/models/geo/fdw/ci/job_artifact_spec.rb
ee/spec/models/geo/fdw/ci/job_artifact_spec.rb
+9
-0
ee/spec/models/geo/fdw/project_spec.rb
ee/spec/models/geo/fdw/project_spec.rb
+1
-0
No files found.
ee/app/models/geo/fdw/ci/job_artifact.rb
View file @
458bb965
...
...
@@ -10,6 +10,8 @@ module Geo
self
.
table_name
=
Gitlab
::
Geo
::
Fdw
.
foreign_table_name
(
'ci_job_artifacts'
)
belongs_to
:project
,
class_name:
'Geo::Fdw::Project'
,
inverse_of: :job_artifacts
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/project.rb
View file @
458bb965
...
...
@@ -7,6 +7,7 @@ module Geo
self
.
table_name
=
Gitlab
::
Geo
::
Fdw
.
foreign_table_name
(
'projects'
)
has_many
:job_artifacts
,
class_name:
'Geo::Fdw::Ci::JobArtifact'
has_many
:lfs_objects_projects
,
class_name:
'Geo::Fdw::LfsObjectsProject'
has_many
:lfs_objects
,
class_name:
'Geo::Fdw::LfsObject'
,
through: :lfs_objects_projects
...
...
ee/spec/models/geo/fdw/ci/job_artifact_spec.rb
0 → 100644
View file @
458bb965
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Geo
::
Fdw
::
Ci
::
JobArtifact
,
:geo
,
type: :model
do
context
'relationships'
do
it
{
is_expected
.
to
belong_to
(
:project
).
class_name
(
'Geo::Fdw::Project'
).
inverse_of
(
:job_artifacts
)
}
end
end
ee/spec/models/geo/fdw/project_spec.rb
View file @
458bb965
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Geo
::
Fdw
::
Project
,
:geo
,
type: :model
do
context
'relationships'
do
it
{
is_expected
.
to
have_many
(
:job_artifacts
).
class_name
(
'Geo::Fdw::Ci::JobArtifact'
)
}
it
{
is_expected
.
to
have_many
(
:lfs_objects_projects
).
class_name
(
'Geo::Fdw::LfsObjectsProject'
)
}
it
{
is_expected
.
to
have_many
(
:lfs_objects
).
class_name
(
'Geo::Fdw::LfsObject'
).
through
(
:lfs_objects_projects
)
}
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