summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-12-14 10:01:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-12-14 10:01:45 +0000
commite715c4b847a8c9557dce49400e0dd309e19f7e82 (patch)
treeb480c661b876bdaaeacca9741e0b9876b33c9fec /lib/redmine
parent3e5f1e326aef37943268410994aeaf2481d5db75 (diff)
downloadredmine-e715c4b847a8c9557dce49400e0dd309e19f7e82.tar.gz
redmine-e715c4b847a8c9557dce49400e0dd309e19f7e82.zip
Removed default values on custom field min and max length.
git-svn-id: http://svn.redmine.org/redmine/trunk@12405 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/field_format.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index 399f7d150..ac27831be 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -218,10 +218,10 @@ module Redmine
unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp)
errs << ::I18n.t('activerecord.errors.messages.invalid')
end
- if custom_field.min_length > 0 and value.length < custom_field.min_length
+ if custom_field.min_length && value.length < custom_field.min_length
errs << ::I18n.t('activerecord.errors.messages.too_short', :count => custom_field.min_length)
end
- if custom_field.max_length > 0 and value.length > custom_field.max_length
+ if custom_field.max_length && custom_field.max_length > 0 && value.length > custom_field.max_length
errs << ::I18n.t('activerecord.errors.messages.too_long', :count => custom_field.max_length)
end
end