版本库名不能是全数字

This commit is contained in:
huang 2016-04-22 10:34:45 +08:00
parent cb2033c80f
commit e23262225a
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class Repository < ActiveRecord::Base
# validates_uniqueness_of :identifier, :allow_blank => true
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
# donwcase letters, digits, dashes, underscores but not digits only
validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true
validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]*[a-zA-Z_\-]+[a-zA-Z0-9_\-]*$/, :allow_blank => true
# Checks if the SCM is enabled when creating a repository
validate :repo_create_validation, :on => :create