diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-18 16:43:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-18 16:43:14 +0000 |
commit | 1737552eca732d53273f0dfbf32bde0bc4ff6657 (patch) | |
tree | ecaf9d7800c66fb8d06385c88bb6c0ee6be4750d /app | |
parent | 9ff16dd41119020f5a63209a7ade9f7a0c341226 (diff) | |
download | redmine-1737552eca732d53273f0dfbf32bde0bc4ff6657.tar.gz redmine-1737552eca732d53273f0dfbf32bde0bc4ff6657.zip |
Fixed that invalid start date is ignored (#12092).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10670 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 0029fffb9..8537ef699 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -525,10 +525,14 @@ class Issue < ActiveRecord::Base end def validate_issue - if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty? + if due_date.nil? && @attributes['due_date'].present? errors.add :due_date, :not_a_date end + if start_date.nil? && @attributes['start_date'].present? + errors.add :start_date, :not_a_date + end + if self.due_date and self.start_date and self.due_date < self.start_date errors.add :due_date, :greater_than_start_date end |