From fbaabb3911c6fec25edc25bfffad94ae2a7c0e28 Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Wed, 29 Jun 2016 14:30:27 -0500 Subject: Rename `enabled_git_access_protocols` to singular. --- app/helpers/application_settings_helper.rb | 4 ++-- app/models/application_setting.rb | 2 +- app/views/admin/application_settings/_form.html.haml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 19403388dc6..6b0dde5dfe6 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -32,11 +32,11 @@ module ApplicationSettingsHelper end def allowed_protocols_present? - current_application_settings.enabled_git_access_protocols.present? + current_application_settings.enabled_git_access_protocol.present? end def enabled_protocol - case current_application_settings.enabled_git_access_protocols + case current_application_settings.enabled_git_access_protocol when 'http' gitlab_config.protocol when 'ssh' diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 314e69fa8b6..7bf618d60b9 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -59,7 +59,7 @@ class ApplicationSetting < ActiveRecord::Base presence: true, inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } } - validates :enabled_git_access_protocols, + validates :enabled_git_access_protocol, inclusion: { in: %w(ssh http), allow_blank: true, allow_nil: true } validates_each :restricted_visibility_levels do |record, attr, value| diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 99bf2701f64..eb325576e4f 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -46,7 +46,7 @@ .form-group %label.control-label.col-sm-2 Enabled Git access protocols .col-sm-10 - = select(:application_setting, :enabled_git_access_protocols, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control') + = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control') %span.help-block#clone-protocol-help Allow only the selected protocols to be used for Git access. .form-group -- cgit v1.2.1