From a78ecb33ff5cba87b96f44b5ce42e9fce24f7a93 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 15 Mar 2024 10:17:27 +0100 Subject: search: further refine the order of things MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- app/models/search.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models') diff --git a/app/models/search.rb b/app/models/search.rb index 81a1c34..7823a74 100644 --- a/app/models/search.rb +++ b/app/models/search.rb @@ -59,9 +59,9 @@ class Search < ApplicationRecord plain.each do |text| res[:things] = if res[:things].any? - res[:things].and(Thing.like(text:)).order('rate DESC, created_at') + res[:things].and(Thing.like(text:)).order('rate DESC, title, created_at') else - Thing.like(text:).order('rate DESC, created_at') + Thing.like(text:).order('rate DESC, title, created_at') end res[:comments] = if res[:comments].any? res[:comments].and(Comment.like(text:)).order(:created_at) -- cgit v1.2.3