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
d338e3f7
Commit
d338e3f7
authored
Mar 07, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add belongs_to :project to Geo::ProjectRegistry
parent
2aae3142
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
app/models/geo/project_registry.rb
app/models/geo/project_registry.rb
+3
-1
spec/models/geo/project_registry_spec.rb
spec/models/geo/project_registry_spec.rb
+5
-1
No files found.
app/models/geo/project_registry.rb
View file @
d338e3f7
class
Geo::ProjectRegistry
<
Geo
::
BaseRegistry
class
Geo::ProjectRegistry
<
Geo
::
BaseRegistry
validates
:project_id
,
presence:
true
belongs_to
:project
validates
:project
,
presence:
true
scope
:failed
,
->
{
where
.
not
(
last_repository_synced_at:
nil
).
where
(
last_repository_successful_sync_at:
nil
)
}
scope
:failed
,
->
{
where
.
not
(
last_repository_synced_at:
nil
).
where
(
last_repository_successful_sync_at:
nil
)
}
scope
:synced
,
->
{
where
.
not
(
last_repository_synced_at:
nil
,
last_repository_successful_sync_at:
nil
)
}
scope
:synced
,
->
{
where
.
not
(
last_repository_synced_at:
nil
,
last_repository_successful_sync_at:
nil
)
}
...
...
spec/models/geo/project_registry_spec.rb
View file @
d338e3f7
require
'spec_helper'
require
'spec_helper'
describe
Geo
::
ProjectRegistry
,
models:
true
do
describe
Geo
::
ProjectRegistry
,
models:
true
do
describe
'relationships'
do
it
{
is_expected
.
to
belong_to
(
:project
)
}
end
describe
'validations'
do
describe
'validations'
do
it
{
is_expected
.
to
validate_presence_of
(
:project
_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project
)
}
end
end
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