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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user