Merged r24549 from trunk to 6.1-stable (#43910).

git-svn-id: https://svn.redmine.org/redmine/branches/6.1-stable@24553 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2026-04-02 23:40:37 +00:00
parent 5da929fa67
commit 42b8988278
2 changed files with 5 additions and 1 deletions

View File

@@ -84,7 +84,9 @@ class Project < ApplicationRecord
validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/,
:if => proc {|p| p.identifier_changed?}
# reserved words
validates_exclusion_of :identifier, :in => %w(new)
validates_exclusion_of :identifier,
:in => %w(new autocomplete bulk_destroy),
:if => -> { new_record? || will_save_change_to_identifier? }
validate :validate_parent
after_update :update_versions_from_hierarchy_change,

View File

@@ -96,6 +96,8 @@ class ProjectTest < ActiveSupport::TestCase
"ab-12" => true,
"ab_12" => true,
"12" => false,
"autocomplete" => false,
'bulk_destroy' => false,
"new" => false}
to_test.each do |identifier, valid|