Allow same name for custom fields on different object types.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1730 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-08-11 18:09:54 +00:00
parent 1650920339
commit 1631019026
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class CustomField < ActiveRecord::Base
}.freeze
validates_presence_of :name, :field_format
validates_uniqueness_of :name
validates_uniqueness_of :name, :scope => :type
validates_length_of :name, :maximum => 30
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys