From 04bf7e74765b9301b928a693db33bc9ac9b5c703 Mon Sep 17 00:00:00 2001 From: inobcr Date: Mon, 8 Feb 2016 13:45:28 +0100 Subject: [PATCH] Ordenar admin/organizaciones por orden de llegada --- app/controllers/admin/organizations_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index a5be3626a..77f71ed65 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -5,11 +5,16 @@ class Admin::OrganizationsController < Admin::BaseController def index @organizations = @organizations.send(@current_filter) - @organizations = @organizations.includes(:user).order(:name, 'users.email').page(params[:page]) + @organizations = @organizations.includes(:user) + .order('users.created_at', :name, 'users.email') + .page(params[:page]) end def search - @organizations = Organization.includes(:user).search(params[:term]).page(params[:page]) + @organizations = Organization.includes(:user) + .search(params[:term]) + .order('users.created_at', :name, 'users.email') + .page(params[:page]) end def verify