Skip to content
Snippets Groups Projects
Commit 20aa777c authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Weigh username matches higher than domain matches in account search

parent afded319
No related branches found
No related tags found
No related merge requests found
......@@ -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) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment