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