summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-05 16:34:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-05 16:34:41 +0000
commit45c93340b78da811d151f16177eeaa59064988f4 (patch)
tree50b6106dfc85cc92daac22db6abc7f171306e4d5 /app/models
parent3e14c3017c037d93e562c3697cf50224dced7b50 (diff)
downloadredmine-45c93340b78da811d151f16177eeaa59064988f4.tar.gz
redmine-45c93340b78da811d151f16177eeaa59064988f4.zip
Negative estimated hours should not be valid (#12735).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11125 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 8a0ef7fa8..998030331 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -67,7 +67,7 @@ class Issue < ActiveRecord::Base
validates_length_of :subject, :maximum => 255
validates_inclusion_of :done_ratio, :in => 0..100
- validates_numericality_of :estimated_hours, :allow_nil => true
+ validates :estimated_hours, :numericality => {:greater_than_or_equal_to => 0, :allow_nil => true, :message => :invalid}
validates :start_date, :date => true
validates :due_date, :date => true
validate :validate_issue, :validate_required_fields