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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
b9c19e2f
Commit
b9c19e2f
authored
Feb 11, 2019
by
John Cai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding convenience method to project model
parent
bac1f72c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
app/models/project.rb
app/models/project.rb
+4
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+15
-0
No files found.
app/models/project.rb
View file @
b9c19e2f
...
...
@@ -2073,6 +2073,10 @@ class Project < ActiveRecord::Base
pool_repository
&
.
link_repository
(
repository
)
end
def
has_pool_repository?
pool_repository
.
present?
end
private
def
merge_requests_allowing_collaboration
(
source_branch
=
nil
)
...
...
spec/models/project_spec.rb
View file @
b9c19e2f
...
...
@@ -4602,6 +4602,21 @@ describe Project do
end
end
describe
'#has_pool_repsitory?'
do
it
'returns false when it does not have a pool repository'
do
subject
=
create
(
:project
,
:repository
)
expect
(
subject
.
has_pool_repository?
).
to
be
false
end
it
'returns true when it has a pool repository'
do
pool
=
create
(
:pool_repository
,
:ready
)
subject
=
create
(
:project
,
:repository
,
pool_repository:
pool
)
expect
(
subject
.
has_pool_repository?
).
to
be
true
end
end
def
rugged_config
rugged_repo
(
project
.
repository
).
config
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