From 3279b2adbda843bfde1c30166f03e75e39c796b2 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Wed, 15 Sep 2010 10:53:00 +0200 Subject: [PATCH] fix mailer tests --- app/models/message.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/message.rb b/app/models/message.rb index 553e5c9f..400c2784 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -26,11 +26,12 @@ class Message < ActiveRecord::Base :event_description => :content, :event_type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'}, :event_url => (Proc.new do |o| - if o.parent_id.nil? - {:id => o.id} + msg = o.journaled + if msg.parent_id.nil? + {:id => msg.id} else - {:id => o.parent_id, :r => o.journaled.id, :anchor => "message-#{o.journaled.id}"} - end.reverse_merge :controller => 'messages', :action => 'show', :board_id => o.board_id + {:id => msg.parent_id, :r => msg.id, :anchor => "message-#{msg.id}"} + end.reverse_merge :controller => 'messages', :action => 'show', :board_id => msg.board_id end), :activity_find_options => { :include => { :board => :project } }