Mercurial > hg > soundsoftware-site
diff app/models/custom_field.rb @ 1494:e248c7af89ec redmine-2.4
Update to Redmine SVN revision 12979 on 2.4-stable branch
author | Chris Cannam |
---|---|
date | Mon, 17 Mar 2014 08:54:02 +0000 |
parents | 261b3d9a4903 |
children | b450a9d58aed |
line wrap: on
line diff
--- a/app/models/custom_field.rb Tue Jan 14 14:37:42 2014 +0000 +++ b/app/models/custom_field.rb Mon Mar 17 08:54:02 2014 +0000 @@ -1,5 +1,5 @@ # Redmine - project management software -# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2006-2014 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -350,7 +350,7 @@ # Returns the error message for the given value regarding its format def validate_field_value_format(value) errs = [] - if value.present? + unless value.to_s == '' errs << ::I18n.t('activerecord.errors.messages.invalid') unless regexp.blank? or value =~ Regexp.new(regexp) errs << ::I18n.t('activerecord.errors.messages.too_short', :count => min_length) if min_length > 0 and value.length < min_length errs << ::I18n.t('activerecord.errors.messages.too_long', :count => max_length) if max_length > 0 and value.length > max_length