mirror of
https://github.com/kikobar/mastodon.git
synced 2024-12-25 15:24:14 +00:00
Weigh username matches higher than domain matches in account search
This commit is contained in:
parent
afded319d2
commit
20aa777c58
|
@ -43,7 +43,7 @@ class Account < ApplicationRecord
|
||||||
|
|
||||||
has_many :media_attachments, dependent: :destroy
|
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 :remote, -> { where.not(domain: nil) }
|
||||||
scope :local, -> { where(domain: nil) }
|
scope :local, -> { where(domain: nil) }
|
||||||
|
|
Loading…
Reference in a new issue