From 7ba245920c6c1b5c72a66a3dc7c6ae16492c13f5 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Wed, 12 Jul 2017 21:46:39 +0200 Subject: [PATCH] Use the same sorting everywhere --- app/controllers/error_template_attributes_controller.rb | 2 +- app/views/error_templates/show.html.slim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/error_template_attributes_controller.rb b/app/controllers/error_template_attributes_controller.rb index e5e0d486..05de2772 100644 --- a/app/controllers/error_template_attributes_controller.rb +++ b/app/controllers/error_template_attributes_controller.rb @@ -9,7 +9,7 @@ class ErrorTemplateAttributesController < ApplicationController # GET /error_template_attributes # GET /error_template_attributes.json def index - @error_template_attributes = ErrorTemplateAttribute.all.order(:id).paginate(page: params[:page]) + @error_template_attributes = ErrorTemplateAttribute.all.order('important DESC', :key, :id).paginate(page: params[:page]) authorize! end diff --git a/app/views/error_templates/show.html.slim b/app/views/error_templates/show.html.slim index 574e3d88..9936ef7f 100644 --- a/app/views/error_templates/show.html.slim +++ b/app/views/error_templates/show.html.slim @@ -20,7 +20,7 @@ h3 th = t('activerecord.attributes.error_template_attribute.regex') th colspan=3 = t('shared.actions') tbody - - @error_template.error_template_attributes.order(:important).each do |attribute| + - @error_template.error_template_attributes.order('important DESC', :key).each do |attribute| tr td - if attribute.important