Fixed: IssueController#edit doesn't set default Activity as default (#1302).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1461 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-05-26 17:12:11 +00:00
parent b3e5f1a1c3
commit d6daeca40a
4 changed files with 23 additions and 1 deletions
+6
View File
@@ -29,6 +29,12 @@ class TimeEntry < ActiveRecord::Base
validates_numericality_of :hours, :allow_nil => true
validates_length_of :comments, :maximum => 255
def after_initialize
if new_record?
self.activity ||= Enumeration.default('ACTI')
end
end
def before_validation
self.project = issue.project if issue && project.nil?
end