Use nullcheck operator instead of checking for null
This commit is contained in:
parent
ca1d6d2f6d
commit
291dc5a21c
|
@ -36,7 +36,7 @@ module Projects
|
|||
end
|
||||
|
||||
def run_auto_devops_pipeline?
|
||||
return false if project.repository.gitlab_ci_yml || project.auto_devops.nil? || !project.auto_devops.previous_changes.include?('enabled')
|
||||
return false if project.repository.gitlab_ci_yml || !project.auto_devops&.previous_changes&.include?('enabled')
|
||||
|
||||
project.auto_devops.enabled? || (project.auto_devops.enabled.nil? && Gitlab::CurrentSettings.auto_devops_enabled?)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue