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
af61265d
Commit
af61265d
authored
Oct 04, 2019
by
Erick Bajao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lessen complexity of closest_setting method
parent
77c10461
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
app/models/project.rb
app/models/project.rb
+5
-4
No files found.
app/models/project.rb
View file @
af61265d
...
...
@@ -2251,10 +2251,7 @@ class Project < ApplicationRecord
end
def
closest_setting
(
name
)
setting
=
read_attribute
(
name
)
setting
||=
closest_namespace_setting
(
name
)
setting
||=
Gitlab
::
CurrentSettings
.
send
(
name
)
# rubocop:disable GitlabSecurity/PublicSend
setting
read_attribute
(
name
)
||
closest_namespace_setting
(
name
)
||
app_settings_for
(
name
)
end
private
...
...
@@ -2266,6 +2263,10 @@ class Project < ApplicationRecord
.
try
(
name
)
end
def
app_settings_for
(
name
)
Gitlab
::
CurrentSettings
.
send
(
name
)
# rubocop:disable GitlabSecurity/PublicSend
end
def
merge_requests_allowing_collaboration
(
source_branch
=
nil
)
relation
=
source_of_merge_requests
.
opened
.
where
(
allow_collaboration:
true
)
relation
=
relation
.
where
(
source_branch:
source_branch
)
if
source_branch
...
...
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