Update for acts_as_journalized_changes

pull/6827/head
Sebastian Schuster 11 years ago
parent ad2373a8fd
commit 13e572796a
  1. 4
      app/models/document.rb

@ -17,9 +17,9 @@ class Document < ActiveRecord::Base
acts_as_attachable :delete_permission => :manage_documents
acts_as_journalized :event_title => Proc.new {|o| "#{Document.model_name.human}: #{o.title}"},
:event_url => Proc.new {|o| {:controller => '/documents', :action => 'show', :id => o.journaled_id}},
:event_url => Proc.new {|o| {:controller => '/documents', :action => 'show', :id => o.journal.journable_id}},
:event_author => (Proc.new do |o|
o.attachments.find(:first, :order => "#{Attachment.table_name}.created_on ASC").try(:author)
o.journal.journable.attachments.find(:first, :order => "#{Attachment.table_name}.created_on ASC").try(:author)
end)
acts_as_searchable :columns => ['title', "#{table_name}.description"], :include => :project

Loading…
Cancel
Save