]> source.dussan.org Git - redmine.git/commitdiff
Allow same name for custom fields on different object types.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Aug 2008 18:09:54 +0000 (18:09 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Aug 2008 18:09:54 +0000 (18:09 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1730 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/custom_field.rb

index 990adf9e2ff00b525d83bb3fb6d79395aef17ae9..7ad19437f0e7aa32ba4d14407d748d208acb9783 100644 (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