This commit is contained in:
sw 2014-07-22 13:49:25 +08:00
commit 47ae398748
2 changed files with 3 additions and 2 deletions

View File

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

View File

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