From 75ba61ed746cea8080e2add86a0630ff4f66412b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 14 Jan 2015 16:42:12 +0800 Subject: [PATCH] =?UTF-8?q?issue=201798=20,=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/document.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/document.rb b/app/models/document.rb index e607b9292..e2e0a8d00 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -31,7 +31,8 @@ class Document < ActiveRecord::Base acts_as_searchable :columns => ['title', "#{table_name}.description"], :include => :project acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"}, - :author => Proc.new {|o| o.attachments.reorder("#{Attachment.table_name}.created_on ASC").first.try(:author) }, + #:author => Proc.new {|o| o.attachments.reorder("#{Attachment.table_name}.created_on ASC").first.try(:author) }, + :author => Proc.new {|o| User.find(o.user_id)}, :url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}} acts_as_activity_provider :find_options => {:include => :project}, :is_public => 'documents.is_public'