sort co_author name
This commit is contained in:
parent
270644a959
commit
16e637260c
|
@ -1,7 +1,7 @@
|
|||
class Desktop::CoAuthorsController < ApplicationController
|
||||
def index
|
||||
@co_authors = CoAuthor.where(name_id: current_user.id).order(["co_author desc"])
|
||||
nils, not_nils = @co_authors.partition {|p| p.email.nil? }
|
||||
nils, not_nils = CoAuthor.where(name_id: current_user.id)\
|
||||
.asc(:co_author).partition{|p| p.email.nil?}
|
||||
@co_authors = not_nils + nils
|
||||
@co_author_relations = CoAuthorRelation.all
|
||||
|
||||
|
|
Reference in New Issue