logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 20aa777c58595cfe82ef0ab7b8853ce735901919
parent: afded319d2558369a025b1f3335cebacc9819881
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Sat, 12 Nov 2016 14:56:40 +0100

Weigh username matches higher than domain matches in account search

Diffstat:

Mapp/models/account.rb2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/account.rb b/app/models/account.rb @@ -43,7 +43,7 @@ class Account < ApplicationRecord has_many :media_attachments, dependent: :destroy - pg_search_scope :search_for, against: %i(username domain), using: { tsearch: { prefix: true } } + pg_search_scope :search_for, against: { username: 'A', domain: 'B' }, using: { tsearch: { prefix: true } } scope :remote, -> { where.not(domain: nil) } scope :local, -> { where(domain: nil) }