chore: Search optimisations (#6644)
- Strip search term before searching - order messages by created_at desc - order contacts by last_activity_at desc - order conversations by created_at desc - Search only resolved contacts - Optimize resolved contacts query ref: #6583
This commit is contained in:
@@ -42,6 +42,8 @@ class Notification < ApplicationRecord
|
||||
|
||||
after_create_commit :process_notification_delivery, :dispatch_create_event
|
||||
|
||||
# TODO: Get rid of default scope
|
||||
# https://stackoverflow.com/a/1834250/939299
|
||||
default_scope { order(id: :desc) }
|
||||
|
||||
PRIMARY_ACTORS = ['Conversation'].freeze
|
||||
|
||||
Reference in New Issue
Block a user