summaryrefslogtreecommitdiffstats
path: root/app/models/custom_value.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-04-08 16:56:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-04-08 16:56:01 +0000
commit1c03b98e5dac5f0c5ab931ce6ae749ad31f1c472 (patch)
treee00a0796ffe0911bbb3d8149ee7af3b2acfccd52 /app/models/custom_value.rb
parenta4a41e05a81b6a7f832b299763e930aa56a1d0ac (diff)
downloadredmine-1c03b98e5dac5f0c5ab931ce6ae749ad31f1c472.tar.gz
redmine-1c03b98e5dac5f0c5ab931ce6ae749ad31f1c472.zip
Fixes that custom values length and attachment size validation error raises an error.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2667 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_value.rb')
-rw-r--r--app/models/custom_value.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb
index 2d7d1cffe..4cace724a 100644
--- a/app/models/custom_value.rb
+++ b/app/models/custom_value.rb
@@ -48,8 +48,8 @@ protected
errors.add(:value, :blank) if custom_field.is_required? and value.blank?
else
errors.add(:value, :invalid) unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp)
- errors.add(:value, :too_short) if custom_field.min_length > 0 and value.length < custom_field.min_length
- errors.add(:value, :too_long) if custom_field.max_length > 0 and value.length > custom_field.max_length
+ errors.add(:value, :too_short, :count => custom_field.min_length) if custom_field.min_length > 0 and value.length < custom_field.min_length
+ errors.add(:value, :too_long, :count => custom_field.max_length) if custom_field.max_length > 0 and value.length > custom_field.max_length
# Format specific validations
case custom_field.field_format