Defect #1302 ยป fix-time_entry-initialization.diff
| app/models/time_entry.rb (working copy) | ||
|---|---|---|
|
validates_length_of :comments, :maximum => 255
|
||
|
def after_initialize
|
||
|
if new_record?
|
||
|
self.activity ||= Enumeration.default('ACTI')
|
||
|
if new_record? && !self.activity
|
||
|
if activity = Enumeration.default('ACTI')
|
||
|
self.activity_id ||= activity.id
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||