From 42c2f6c2eeb94ff52d366c4fd9e7bf5f10f2a7ef Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 22 Jul 2014 13:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=8C=89=E4=BD=9C=E8=80=85=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/documents_controller.rb | 3 ++- db/schema.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index b0ad6b109..2b92c32bb 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -42,7 +42,8 @@ class DocumentsController < ApplicationController when 'title' @grouped = documents.group_by {|d| d.title.first.upcase} when 'author' - @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author} + # @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author} + @grouped = documents.group_by {|d| d.user.name } else @grouped = documents.group_by(&:category) end diff --git a/db/schema.rb b/db/schema.rb index 05d24bf9b..20858ec97 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140721074353) do +ActiveRecord::Schema.define(:version => 20140722024513) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false