Patch #3785 » app.models.time_entry.rb.diff
| app\models\time_entry.rb Wed Aug 26 13:20:37 2009 | ||
|---|---|---|
| 26 | 26 | attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek | 
| 27 | 27 |  | 
| 28 | 28 | acts_as_customizable | 
| 29 |   acts_as_event :title => Proc.new {|o| "#{o.user}: #{lwr(:label_f_hour, o.hours)} (#{(o.issue || o.project).event_title})"},
 | |
| 30 |                 :url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project}},
 | |
| 29 |   acts_as_event :title => Proc.new {|o| "#{lwr(:label_f_hour, o.hours)} (#{(o.issue || o.project).event_title})"},
 | |
| 30 |                 :url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project, :issue_id => o.issue}},
 | |
| 31 | 31 | :author => :user, | 
| 32 | 32 | :description => :comments | 
| 33 |  | |
| 34 |  | |
| 35 |   acts_as_activity_provider :timestamp => "#{table_name}.created_on",
 | |
| 36 | :author_key => :user_id, | |
| 37 |                             :find_options => {:include => :project} 
 | |
| 38 |  | |
| 39 |  | |
| 40 | acts_as_searchable :columns => 'comments', | |
| 41 | :project_key => ".project_id", | |
| 42 |                      :date_column => "#{table_name}.created_on"
 | |
| 43 |  | |
| 33 | 44 |  | 
| 34 | 45 | validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on | 
| 35 | 46 | validates_numericality_of :hours, :allow_nil => true, :message => :activerecord_error_invalid |