summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-08 08:42:17 +0000
committerDouwe Maan <douwe@gitlab.com>2015-12-08 08:42:17 +0000
commitf5430e48b42227f1c1874ca27c6907f0f704be28 (patch)
tree3f9f71598586e1b2963ad00b92d80555d1fb8377 /app/models/project.rb
parent1d605f63650ca7dfedb766d41cf15f33f0bd2e51 (diff)
parent2379c8beeac600c3352e33fda0c2b4f4f39c8b84 (diff)
downloadgitlab-ce-f5430e48b42227f1c1874ca27c6907f0f704be28.tar.gz
Merge branch 'rs-validators' into 'master'
Add more custom validators These custom validators allow us to DRY up our models a bit. See merge request !1944
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 6010770a5f2..af034a6692b 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -152,7 +152,7 @@ class Project < ActiveRecord::Base
validates_uniqueness_of :name, scope: :namespace_id
validates_uniqueness_of :path, scope: :namespace_id
validates :import_url,
- format: { with: /\A#{URI.regexp(%w(ssh git http https))}\z/, message: 'should be a valid url' },
+ url: { protocols: %w(ssh git http https) },
if: :external_import?
validates :star_count, numericality: { greater_than_or_equal_to: 0 }
validate :check_limit, on: :create