diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-17 20:01:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-17 20:01:15 +0000 |
commit | 062a2d6f5d6ebdc74d5586cb151fd07a219b1b31 (patch) | |
tree | dd1ed26471c73532688ec74ed72e1eaeeb8a47f7 /app/models/time_entry.rb | |
parent | d991e46f122d084c9465073256e7750b24898d49 (diff) | |
download | redmine-062a2d6f5d6ebdc74d5586cb151fd07a219b1b31.tar.gz redmine-062a2d6f5d6ebdc74d5586cb151fd07a219b1b31.zip |
Adds atom feed on time entries details (#1479).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1560 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r-- | app/models/time_entry.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index b234a8b21..61b53d1c0 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -24,6 +24,11 @@ class TimeEntry < ActiveRecord::Base belongs_to :activity, :class_name => 'Enumeration', :foreign_key => :activity_id attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek + + acts_as_event :title => Proc.new {|o| "#{o.user}: #{lwr(:label_f_hour, o.hours)} (#{(o.issue || o.project).event_title})"}, + :url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project}}, + :author => :user, + :description => :comments validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on validates_numericality_of :hours, :allow_nil => true |