BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
cb1f3423
Commit
cb1f3423
authored
Jul 03, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't resolve fork relationships for projects pending delete
parent
1501a4f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
forked_project_link.rb
app/models/forked_project_link.rb
+2
-2
forked_project_link_spec.rb
spec/models/forked_project_link_spec.rb
+16
-0
No files found.
app/models/forked_project_link.rb
View file @
cb1f3423
class
ForkedProjectLink
<
ActiveRecord
::
Base
belongs_to
:forked_to_project
,
class_name:
'Project'
belongs_to
:forked_from_project
,
class_name:
'Project'
belongs_to
:forked_to_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
belongs_to
:forked_from_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
end
spec/models/forked_project_link_spec.rb
View file @
cb1f3423
...
...
@@ -24,6 +24,22 @@ describe ForkedProjectLink, "add link on fork" do
expect
(
project_to
.
forked_from_project
).
to
eq
(
project_from
)
end
context
'project_to is pending_delete'
do
before
do
project_to
.
update!
(
pending_delete:
true
)
end
it
{
expect
(
project_from
.
forks
.
count
).
to
eq
(
0
)
}
end
context
'project_from is pending_delete'
do
before
do
project_from
.
update!
(
pending_delete:
true
)
end
it
{
expect
(
project_to
.
forked_from_project
).
to
be_nil
}
end
describe
'#forked?'
do
let
(
:project_to
)
{
create
(
:project
,
forked_project_link:
forked_project_link
)
}
let
(
:forked_project_link
)
{
build
(
:forked_project_link
)
}
...
...
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