Patch #3785 » app.models.time_entry.rb.diff
| app\models\time_entry.rb Wed Aug 26 13:20:37 2009 | ||
|---|---|---|
|
attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek
|
||
|
|
||
|
acts_as_customizable
|
||
|
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}},
|
||
|
acts_as_event :title => Proc.new {|o| "#{lwr(:label_f_hour, 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}
|
||
|
|
||
|
|
||
|
acts_as_searchable :columns => 'comments',
|
||
|
:project_key => ".project_id",
|
||
|
:date_column => "#{table_name}.created_on"
|
||
|
|
||
|
|
||
|
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
|
||
|
validates_numericality_of :hours, :allow_nil => true, :message => :activerecord_error_invalid
|
||