From 4681f0ee36af9b38379dd9a37b902d465141c00d Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Wed, 5 Dec 2012 18:34:29 +0800 Subject: [PATCH] sort co_author name --- app/controllers/desktop/co_authors_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/desktop/co_authors_controller.rb b/app/controllers/desktop/co_authors_controller.rb index ec2327dd..6d7b41d6 100644 --- a/app/controllers/desktop/co_authors_controller.rb +++ b/app/controllers/desktop/co_authors_controller.rb @@ -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