Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
af61265d
Commit
af61265d
authored
5 years ago
by
Erick Bajao
Browse files
Options
Downloads
Patches
Plain Diff
Lessen complexity of closest_setting method
parent
77c10461
Loading
Loading
1 merge request
!17769
Update artifact size authorization
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/project.rb
+5
-4
5 additions, 4 deletions
app/models/project.rb
with
5 additions
and
4 deletions
app/models/project.rb
+
5
−
4
View file @
af61265d
...
...
@@ -2251,10 +2251,7 @@ def pages_lookup_path(trim_prefix: nil, domain: nil)
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 @@ def closest_namespace_setting(name)
.
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment