summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-03-23 10:50:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-03-23 10:50:42 +0000
commit1f2cbee0aab9938fcd5f91cdd4f1faae200fc8f4 (patch)
tree1d0a5afbc36b8050313edc952042dac15c66a0b3
parent6f6201f9067f0da36cf070baff4354c96c435333 (diff)
downloadredmine-1f2cbee0aab9938fcd5f91cdd4f1faae200fc8f4.tar.gz
redmine-1f2cbee0aab9938fcd5f91cdd4f1faae200fc8f4.zip
added issue validation on time_entry
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@366 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--time/app/models/time_entry.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/time/app/models/time_entry.rb b/time/app/models/time_entry.rb
index a8c542a90..513652911 100644
--- a/time/app/models/time_entry.rb
+++ b/time/app/models/time_entry.rb
@@ -17,7 +17,7 @@ class TimeEntry < ActiveRecord::Base
def validate
errors.add :hours, :activerecord_error_invalid if hours && hours < 0
errors.add :project_id, :activerecord_error_invalid if project.nil?
- errors.add :issue_id, :activerecord_error_invalid if issue && project!=issue.project
+ errors.add :issue_id, :activerecord_error_invalid if (issue_id && !issue) || (issue && project!=issue.project)
end
def spent_on=(date)