瀏覽代碼

Repository identifiers can be reserved words (#16564).

Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@13127 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/2.6.0
Jean-Philippe Lang 10 年之前
父節點
當前提交
ef4cacdb66
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      app/models/repository.rb

+ 1
- 1
app/models/repository.rb 查看文件

@@ -40,7 +40,7 @@ class Repository < ActiveRecord::Base
validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true
validates_presence_of :identifier, :unless => Proc.new { |r| r.is_default? || r.set_as_default? }
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)
validates_exclusion_of :identifier, :in => %w(browse show entry raw changes annotate diff statistics graph revisions revision)
# donwcase letters, digits, dashes, underscores but not digits only
validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :allow_blank => true
# Checks if the SCM is enabled when creating a repository

Loading…
取消
儲存