summaryrefslogtreecommitdiffstats
path: root/app/models/custom_value.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 17:07:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 17:07:28 +0000
commitc8b3c8dfec4c768658be5482234c7a05808e6963 (patch)
tree16862470de00f6ce378d9303eb82cb37c1dd3ab0 /app/models/custom_value.rb
parent603e11d7a5aa62f923e7b013cac6c66462131232 (diff)
downloadredmine-c8b3c8dfec4c768658be5482234c7a05808e6963.tar.gz
redmine-c8b3c8dfec4c768658be5482234c7a05808e6963.zip
Fix: error when posting to projects/add or users/add with no custom_fields parameter.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@675 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_value.rb')
-rw-r--r--app/models/custom_value.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb
index e12c14376..6cc4d16bf 100644
--- a/app/models/custom_value.rb
+++ b/app/models/custom_value.rb
@@ -21,7 +21,7 @@ class CustomValue < ActiveRecord::Base
protected
def validate
- errors.add(:value, :activerecord_error_blank) and return if custom_field.is_required? and value.empty?
+ errors.add(:value, :activerecord_error_blank) and return if custom_field.is_required? and value.blank?
errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp)
errors.add(:value, :activerecord_error_too_short) if custom_field.min_length > 0 and value.length < custom_field.min_length and value.length > 0
errors.add(:value, :activerecord_error_too_long) if custom_field.max_length > 0 and value.length > custom_field.max_length