From aac8bbba2041a871ea068e2182bcab01c72d1b6b Mon Sep 17 00:00:00 2001 From: Remo Mueller Date: Tue, 3 Sep 2019 20:55:41 -0400 Subject: [PATCH] Folders are now sorted alphabetically in each category, addresses #11. --- CHANGELOG.md | 2 ++ app/models/category.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89fd8f9..82c4692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## 12.0.0 ### Enhancements +- **Folder Changes** + - Folders are now sorted alphabetically in each category - **Document Changes** - Reduced size of folder names in documents sidebar - Admins can now set keywords for documents to improve search results for diff --git a/app/models/category.rb b/app/models/category.rb index 9a418b9..912a272 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -21,5 +21,5 @@ class Category < ApplicationRecord allow_nil: true # Relationships - has_many :folders, -> { order(Arel.sql("folders.position nulls last")) }, dependent: :destroy + has_many :folders, -> { order(:name) }, dependent: :destroy end