forgot a few versioned => journaled conversions

pull/351/head
Tim Felgentreff 14 years ago
parent 3279b2adbd
commit 6863c00359
  1. 2
      app/models/document.rb
  2. 4
      app/models/mail_handler.rb
  3. 2
      app/models/news.rb
  4. 5
      app/views/search/index.rhtml

@ -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)

@ -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

@ -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)

@ -26,7 +26,10 @@
<h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
<dl id="search-results">
<% @results.each do |e| %>
<dt class="<%= e.event_type %>"><%= 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 %></dt>
<dt class="<%= e.event_type %>">
<%= 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 %>
</dt>
<dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
<span class="author"><%= format_time(e.event_datetime) %></span></dd>
<% end %>

Loading…
Cancel
Save