about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-12 14:56:40 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-12 14:56:40 +0100
commit20aa777c58595cfe82ef0ab7b8853ce735901919 (patch)
treee7ac2ab83da2c3e521c48535dd7999e5bf1a5750 /app/models
parentafded319d2558369a025b1f3335cebacc9819881 (diff)
Weigh username matches higher than domain matches in account search
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 19300f48b..47de161d8 100644
--- 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) }