diff options
author | James Lopez <james@jameslopez.es> | 2016-06-30 13:17:37 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-06-30 13:17:37 +0200 |
commit | 5b893d603dd68f263129523f13e8eb68b67fe790 (patch) | |
tree | f17be7ff52f89672f6895c45d0c15e687e50527a /db | |
parent | 0ca275748314a27a1f36e12fe1360df11c9be25d (diff) | |
download | gitlab-ce-5b893d603dd68f263129523f13e8eb68b67fe790.tar.gz |
few changes based on feedback
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160620110927_fix_no_validatable_import_url.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/db/migrate/20160620110927_fix_no_validatable_import_url.rb b/db/migrate/20160620110927_fix_no_validatable_import_url.rb index 9cb84faaec1..e111691ea3c 100644 --- a/db/migrate/20160620110927_fix_no_validatable_import_url.rb +++ b/db/migrate/20160620110927_fix_no_validatable_import_url.rb @@ -38,8 +38,6 @@ class FixNoValidatableImportUrl < ActiveRecord::Migration def valid_url?(value) return false unless value - value.strip! - valid_uri?(value) && valid_protocol?(value) rescue Addressable::URI::InvalidURIError false @@ -50,11 +48,13 @@ class FixNoValidatableImportUrl < ActiveRecord::Migration end def valid_protocol?(value) - !!(value =~ /\A#{URI.regexp(%w(http https ssh git))}\z/) + value =~ /\A#{URI.regexp(%w(http https ssh git))}\z/ end end def up + return unless defined?(Addressable::URI::InvalidURIError) + say('Cleaning up invalid import URLs... This may take a few minutes if we have a large number of imported projects.') invalid_import_url_project_ids.each { |project_id| cleanup_import_url(project_id) } |