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
f046893a
Commit
f046893a
authored
Jun 22, 2021
by
Mark Lapierre
Committed by
Nikola Milojevic
Jun 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace delegated predicates with methods that return false when nil
parent
69738e4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
6 deletions
+41
-6
app/models/project.rb
app/models/project.rb
+41
-6
No files found.
app/models/project.rb
View file @
f046893a
...
...
@@ -424,17 +424,16 @@ class Project < ApplicationRecord
delegate
:members
,
to: :team
,
prefix:
true
delegate
:add_user
,
:add_users
,
to: :team
delegate
:add_guest
,
:add_reporter
,
:add_developer
,
:add_maintainer
,
:add_role
,
to: :team
delegate
:group_runners_enabled
,
:group_runners_enabled
=
,
:group_runners_enabled?
,
to: :ci_cd_settings
,
allow_nil:
true
delegate
:group_runners_enabled
,
:group_runners_enabled
=
,
to: :ci_cd_settings
,
allow_nil:
true
delegate
:root_ancestor
,
to: :namespace
,
allow_nil:
true
delegate
:last_pipeline
,
to: :commit
,
allow_nil:
true
delegate
:external_dashboard_url
,
to: :metrics_setting
,
allow_nil:
true
,
prefix:
true
delegate
:dashboard_timezone
,
to: :metrics_setting
,
allow_nil:
true
,
prefix:
true
delegate
:default_git_depth
,
:default_git_depth
=
,
to: :ci_cd_settings
,
prefix: :ci
,
allow_nil:
true
delegate
:forward_deployment_enabled
,
:forward_deployment_enabled
=
,
:forward_deployment_enabled?
,
to: :ci_cd_settings
,
prefix: :ci
,
allow_nil:
true
delegate
:job_token_scope_enabled
,
:job_token_scope_enabled
=
,
:job_token_scope_enabled?
,
to: :ci_cd_settings
,
prefix: :ci
,
allow_nil:
true
delegate
:keep_latest_artifact
,
:keep_latest_artifact
=
,
:keep_latest_artifact?
,
:keep_latest_artifacts_available?
,
to: :ci_cd_settings
,
allow_nil:
true
delegate
:restrict_user_defined_variables
,
:restrict_user_defined_variables
=
,
:restrict_user_defined_variables?
,
to: :ci_cd_settings
,
allow_nil:
true
delegate
:forward_deployment_enabled
,
:forward_deployment_enabled
=
,
to: :ci_cd_settings
,
prefix: :ci
,
allow_nil:
true
delegate
:job_token_scope_enabled
,
:job_token_scope_enabled
=
,
to: :ci_cd_settings
,
prefix: :ci
,
allow_nil:
true
delegate
:keep_latest_artifact
,
:keep_latest_artifact
=
,
to: :ci_cd_settings
,
allow_nil:
true
delegate
:restrict_user_defined_variables
,
:restrict_user_defined_variables
=
,
to: :ci_cd_settings
,
allow_nil:
true
delegate
:actual_limits
,
:actual_plan_name
,
to: :namespace
,
allow_nil:
true
delegate
:allow_merge_on_skipped_pipeline
,
:allow_merge_on_skipped_pipeline?
,
:allow_merge_on_skipped_pipeline
=
,
:has_confluence?
,
:allow_editing_commit_messages?
,
...
...
@@ -2831,6 +2830,42 @@ class Project < ApplicationRecord
def
online_runners_with_tags
@online_runners_with_tags
||=
active_runners_with_tags
.
online
end
def
ci_forward_deployment_enabled?
return
false
unless
ci_cd_settings
ci_cd_settings
.
forward_deployment_enabled?
end
def
ci_job_token_scope_enabled?
return
false
unless
ci_cd_settings
ci_cd_settings
.
job_token_scope_enabled?
end
def
restrict_user_defined_variables?
return
false
unless
ci_cd_settings
ci_cd_settings
.
restrict_user_defined_variables?
end
def
keep_latest_artifacts_available?
return
false
unless
ci_cd_settings
ci_cd_settings
.
keep_latest_artifacts_available?
end
def
keep_latest_artifact?
return
false
unless
ci_cd_settings
ci_cd_settings
.
keep_latest_artifact?
end
def
group_runners_enabled?
return
false
unless
ci_cd_settings
ci_cd_settings
.
group_runners_enabled?
end
end
Project
.
prepend_mod_with
(
'Project'
)
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