summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-24 12:28:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-24 12:28:44 +0000
commit458800c1d5755e068210259adf42de1d3c373f90 (patch)
tree1744812d66ce0ca87611bd33f714b2483cd6e9ee /app/models/time_entry.rb
parent0a6a7f0ed7be045640f98cbb14a61588995670c1 (diff)
downloadredmine-458800c1d5755e068210259adf42de1d3c373f90.tar.gz
redmine-458800c1d5755e068210259adf42de1d3c373f90.zip
Time entry with 2 digits year should not validate (#3107).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11472 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r--app/models/time_entry.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index 94545cd55..76200e09f 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -40,6 +40,7 @@ class TimeEntry < ActiveRecord::Base
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
validates_numericality_of :hours, :allow_nil => true, :message => :invalid
validates_length_of :comments, :maximum => 255, :allow_nil => true
+ validates :spent_on, :date => true
before_validation :set_project_if_nil
validate :validate_time_entry