Allow underscores in project identifiers (#1363).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8708 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-27 17:34:58 +00:00
parent ffbd3c0522
commit 9d372ce6f5
5 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class Project < ActiveRecord::Base
validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH
# donwcase letters, digits, dashes but not digits only
validates_format_of :identifier, :with => /^(?!\d+$)[a-z0-9\-]*$/, :if => Proc.new { |p| p.identifier_changed? }
validates_format_of :identifier, :with => /^(?!\d+$)[a-z0-9\-_]*$/, :if => Proc.new { |p| p.identifier_changed? }
# reserved words
validates_exclusion_of :identifier, :in => %w( new )