Commit 69738e4a authored by Mark Lapierre's avatar Mark Lapierre Committed by Nikola Milojevic

Allow nil in EE methods delegated to ci_cd_settings

Includes predicates as methods to avoid returning nil instead of false
parent b30023ab
...@@ -199,10 +199,10 @@ module EE ...@@ -199,10 +199,10 @@ module EE
delegate :ci_minutes_quota, to: :shared_runners_limit_namespace delegate :ci_minutes_quota, to: :shared_runners_limit_namespace
delegate :merge_pipelines_enabled, :merge_pipelines_enabled=, :merge_pipelines_enabled?, :merge_pipelines_were_disabled?, to: :ci_cd_settings delegate :merge_pipelines_enabled, :merge_pipelines_enabled=, to: :ci_cd_settings, allow_nil: true
delegate :merge_trains_enabled, :merge_trains_enabled=, :merge_trains_enabled?, to: :ci_cd_settings delegate :merge_trains_enabled, :merge_trains_enabled=, to: :ci_cd_settings, allow_nil: true
delegate :auto_rollback_enabled, :auto_rollback_enabled=, :auto_rollback_enabled?, to: :ci_cd_settings delegate :auto_rollback_enabled, :auto_rollback_enabled=, to: :ci_cd_settings, allow_nil: true
delegate :closest_gitlab_subscription, to: :namespace delegate :closest_gitlab_subscription, to: :namespace
delegate :requirements_access_level, to: :project_feature, allow_nil: true delegate :requirements_access_level, to: :project_feature, allow_nil: true
...@@ -877,5 +877,29 @@ module EE ...@@ -877,5 +877,29 @@ module EE
end end
end end
end end
def merge_pipelines_enabled?
return false unless ci_cd_settings
ci_cd_settings.merge_pipelines_enabled?
end
def merge_pipelines_were_disabled?
return false unless ci_cd_settings
ci_cd_settings.merge_pipelines_were_disabled?
end
def merge_trains_enabled?
return false unless ci_cd_settings
ci_cd_settings.merge_trains_enabled?
end
def auto_rollback_enabled?
return false unless ci_cd_settings
ci_cd_settings.auto_rollback_enabled?
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment