Fix AutoDevOpsHelper helper methods

This commit is contained in:
Matija Čupić 2018-02-02 01:21:56 +01:00
parent e5ee1d6a29
commit c120b7a1fe
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 5 additions and 5 deletions

View File

@ -9,28 +9,28 @@ module AutoDevopsHelper
end
def auto_devops_warning_message(project)
if missing_service?
if missing_service?(project)
params = {
kubernetes: link_to('Kubernetes cluster', project_clusters_path(project))
}
if missing_domain?
if missing_domain?(project)
_('Auto Review Apps and Auto Deploy need a domain name and a %{kubernetes} to work correctly.') % params
else
_('Auto Review Apps and Auto Deploy need a %{kubernetes} to work correctly.') % params
end
elsif missing_domain?
elsif missing_domain?(project)
_('Auto Review Apps and Auto Deploy need a domain name to work correctly.')
end
end
private
def missing_domain?
def missing_domain?(project)
!(project.auto_devops&.has_domain? || current_application_settings.auto_devops_domain.present?)
end
def missing_service?
def missing_service?(project)
!project.deployment_platform&.active?
end
end