From 6863c003596d43207032ac5535210b55b0408489 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Wed, 15 Sep 2010 11:05:42 +0200 Subject: [PATCH] forgot a few versioned => journaled conversions --- app/models/document.rb | 2 +- app/models/mail_handler.rb | 4 ++-- app/models/news.rb | 2 +- app/views/search/index.rhtml | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/models/document.rb b/app/models/document.rb index fc5d15dd..a2c2088c 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -21,7 +21,7 @@ class Document < ActiveRecord::Base acts_as_attachable :delete_permission => :manage_documents acts_as_journalized :event_title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"}, - :event_url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.versioned_id}}, + :event_url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.journaled_id}}, :event_author => (Proc.new do |o| o.attachments.find(:first, :order => "#{Attachment.table_name}.created_on ASC").try(:author) end) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 6feb4e0f..ca496b3a 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -197,8 +197,8 @@ class MailHandler < ActionMailer::Base # Reply will be added to the issue def receive_journal_reply(journal_id) journal = Journal.find_by_id(journal_id) - if journal and journal.versioned.is_a? Issue - receive_issue_reply(journal.versioned_id) + if journal and journal.journaled.is_a? Issue + receive_issue_reply(journal.journaled_id) end end diff --git a/app/models/news.rb b/app/models/news.rb index 46769876..9ded1e9e 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -24,7 +24,7 @@ class News < ActiveRecord::Base validates_length_of :title, :maximum => 60 validates_length_of :summary, :maximum => 255 - acts_as_journalized :event_url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.versioned_id} } + acts_as_journalized :event_url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.journaled_id} } acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project def visible?(user=User.current) diff --git a/app/views/search/index.rhtml b/app/views/search/index.rhtml index 348421d3..b692ad73 100644 --- a/app/views/search/index.rhtml +++ b/app/views/search/index.rhtml @@ -26,7 +26,10 @@

<%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)

<% @results.each do |e| %> -
<%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(e.event_title, :length => 255), @tokens), e.event_url %>
+
+ <%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> + <%= link_to highlight_tokens(truncate(e.event_title, :length => 255), @tokens), e.event_url %> +
<%= highlight_tokens(e.event_description, @tokens) %> <%= format_time(e.event_datetime) %>
<% end %>