|
|
|
@ -42,7 +42,7 @@ class Repository < ActiveRecord::Base
|
|
|
|
|
validates_uniqueness_of :identifier, :scope => :project_id, :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(?!\d+$)[a-z0-9\-_]*\z/, :allow_blank => true
|
|
|
|
|
validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]+$/, :allow_blank => true
|
|
|
|
|
# Checks if the SCM is enabled when creating a repository
|
|
|
|
|
validate :repo_create_validation, :on => :create
|
|
|
|
|
|
|
|
|
|