From eeae2685091bc0b4c9e8f3f73fbd562ce10d30ea Mon Sep 17 00:00:00 2001 From: alexdbondoc17 Date: Thu, 3 Mar 2022 02:44:37 +0000 Subject: [PATCH 1/2] Add `order_by` in `annotations#search` --- app/controllers/concerns/annotation_search.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/concerns/annotation_search.rb b/app/controllers/concerns/annotation_search.rb index 5f77f6e..8545c9f 100644 --- a/app/controllers/concerns/annotation_search.rb +++ b/app/controllers/concerns/annotation_search.rb @@ -9,6 +9,8 @@ module AnnotationSearch with field, search_params[field] if search_params[field].present? end + order_by :created_at, :desc + paginate page: search_params[:page] || 1, per_page: search_params[:per_page] || 20 end From 7960921520492749afd0c872539e0f3662804c69 Mon Sep 17 00:00:00 2001 From: alexdbondoc17 Date: Thu, 3 Mar 2022 02:46:03 +0000 Subject: [PATCH 2/2] Fix `searchable` for `citation_finder` in `document` --- app/models/cdao/document.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/cdao/document.rb b/app/models/cdao/document.rb index 3d9deb6..59d5831 100644 --- a/app/models/cdao/document.rb +++ b/app/models/cdao/document.rb @@ -77,6 +77,8 @@ class Cdao::Document < Cdao::Base is_only_in_premium_libraries? end - string :citation_finders_names, multiple: true + string :citation_finders_names, multiple: true do + citation_finders_names + end end end