Convert models to use new search includes mechanism
This commit is contained in:
@@ -28,7 +28,7 @@ class Comment < ApplicationRecord
|
||||
def search(params)
|
||||
q = super
|
||||
|
||||
q = q.search_attributes(params, :post, :creator, :updater, :is_deleted, :is_sticky, :do_not_bump_post, :body, :score)
|
||||
q = q.search_attributes(params, :is_deleted, :is_sticky, :do_not_bump_post, :body, :score)
|
||||
q = q.text_attribute_matches(:body, params[:body_matches], index_column: :body_index)
|
||||
|
||||
case params[:order]
|
||||
@@ -140,6 +140,10 @@ class Comment < ApplicationRecord
|
||||
DText.quote(body, creator.name)
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:post, :creator, :updater]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:post, :creator, :updater]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user