diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 990adf9e..7ad19437 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -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