summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-14 12:31:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-14 12:31:32 +0000
commit846045fd05909689644f4858897ac3fda7fdac36 (patch)
tree2f58877d6a8cc95baa17073d7199173983f7e653 /app/models/time_entry.rb
parent40a9bbe946848861cd37d2f300806490bed9194d (diff)
downloadredmine-846045fd05909689644f4858897ac3fda7fdac36.tar.gz
redmine-846045fd05909689644f4858897ac3fda7fdac36.zip
Fixed: time entries created with the default activity even if a different one is specified (#1302).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1533 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r--app/models/time_entry.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index 4bd2d33b8..b234a8b21 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -30,8 +30,10 @@ class TimeEntry < ActiveRecord::Base
validates_length_of :comments, :maximum => 255
def after_initialize
- if new_record?
- self.activity ||= Enumeration.default('ACTI')
+ if new_record? && self.activity.nil?
+ if default_activity = Enumeration.default('ACTI')
+ self.activity_id = default_activity.id
+ end
end
end