|
|
|
@ -17,9 +17,15 @@ class CostObject < ActiveRecord::Base |
|
|
|
|
acts_as_event :title => Proc.new {|o| "#{l(:label_cost_object)} ##{o.id}: #{o.subject}"}, |
|
|
|
|
:url => Proc.new {|o| {:controller => 'cost_objects', :action => 'show', :id => o.id}} |
|
|
|
|
|
|
|
|
|
acts_as_activity_provider :find_options => {:include => [:project, :author]}, |
|
|
|
|
:timestamp => "#{table_name}.updated_on", |
|
|
|
|
:author_key => :author_id |
|
|
|
|
if respond_to? :acts_as_journalized |
|
|
|
|
acts_as_journalized :activity_find_options => {:include => [:project, :author]}, |
|
|
|
|
:activity_timestamp => "#{table_name}.updated_on", |
|
|
|
|
:activity_author_key => :author_id |
|
|
|
|
else |
|
|
|
|
acts_as_activity_provider :find_options => {:include => [:project, :author]}, |
|
|
|
|
:timestamp => "#{table_name}.updated_on", |
|
|
|
|
:author_key => :author_id |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
validates_presence_of :subject, :project, :author, :kind |
|
|
|
|
validates_length_of :subject, :maximum => 255 |
|
|
|
@ -148,4 +154,4 @@ class CostObject < ActiveRecord::Base |
|
|
|
|
return "issue cost_object" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|