diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-09-12 10:37:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-09-12 10:37:49 +0000 |
commit | 8faa66f68fb26b3da7050247d1cb024187f2f67f (patch) | |
tree | b04ccdcf1d919f32baae9ad3972f14694b4af28b /app/models/time_entry.rb | |
parent | 563c927e1306c0d5e65965c50744a2db5902b208 (diff) | |
download | redmine-8faa66f68fb26b3da7050247d1cb024187f2f67f.tar.gz redmine-8faa66f68fb26b3da7050247d1cb024187f2f67f.zip |
Adds spent time to the activity view (#3809).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2877 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r-- | app/models/time_entry.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index e6cbdfee9..91996ba2f 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -26,11 +26,15 @@ class TimeEntry < ActiveRecord::Base attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek acts_as_customizable - acts_as_event :title => Proc.new {|o| "#{o.user}: #{l_hours(o.hours)} (#{(o.issue || o.project).event_title})"}, - :url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project}}, + acts_as_event :title => Proc.new {|o| "#{l_hours(o.hours)} (#{(o.issue || o.project).event_title})"}, + :url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project, :issue_id => o.issue}}, :author => :user, :description => :comments - + + acts_as_activity_provider :timestamp => "#{table_name}.created_on", + :author_key => :user_id, + :find_options => {:include => :project} + validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on validates_numericality_of :hours, :allow_nil => true, :message => :invalid validates_length_of :comments, :maximum => 255, :allow_nil => true |