更改项目文档按作者排序
This commit is contained in:
parent
09f13409de
commit
42c2f6c2ee
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue