|
|
@ -33,15 +33,14 @@ class Message < ActiveRecord::Base
|
|
|
|
:date_column => "#{table_name}.created_on"
|
|
|
|
:date_column => "#{table_name}.created_on"
|
|
|
|
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
|
|
|
|
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
|
|
|
|
:description => :content,
|
|
|
|
:description => :content,
|
|
|
|
:datetime => :created_on,
|
|
|
|
# :datetime => "#{Message.table_name}.created_on",
|
|
|
|
:group => :parent,
|
|
|
|
:group => :parent,
|
|
|
|
:type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'},
|
|
|
|
:type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'},
|
|
|
|
:url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id}.merge(o.parent_id.nil? ? {:id => o.id} :
|
|
|
|
:url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id}.merge(o.parent_id.nil? ? {:id => o.id} :
|
|
|
|
{:id => o.parent_id, :r => o.id, :anchor => "message-#{o.id}"})}
|
|
|
|
{:id => o.parent_id, :r => o.id, :anchor => "message-#{o.id}"})}
|
|
|
|
|
|
|
|
|
|
|
|
acts_as_activity_provider :find_options => {:include => [{:board => :project}, :author]},
|
|
|
|
acts_as_activity_provider :find_options => {:include => [{:board => :project}, :author]},
|
|
|
|
:author_key => :author_id,
|
|
|
|
:author_key => :author_id
|
|
|
|
:timestamp => :created_on
|
|
|
|
|
|
|
|
acts_as_watchable
|
|
|
|
acts_as_watchable
|
|
|
|
|
|
|
|
|
|
|
|
validates_presence_of :board, :subject, :content
|
|
|
|
validates_presence_of :board, :subject, :content
|
|
|
|