searchable: refactor searchable_includes.
Pass searchable associations directly to search_attributes instead of defining them separately in searchable_includes.
This commit is contained in:
@@ -86,7 +86,7 @@ class ForumTopic < ApplicationRecord
|
||||
end
|
||||
|
||||
def search(params)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :is_sticky, :is_locked, :is_deleted, :category_id, :title, :response_count)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :is_sticky, :is_locked, :is_deleted, :category_id, :title, :response_count, :creator, :updater, :forum_posts, :bulk_update_requests, :tag_aliases, :tag_implications)
|
||||
q = q.text_attribute_matches(:title, params[:title_matches], index_column: :text_index)
|
||||
|
||||
if params[:is_private].to_s.truthy?
|
||||
@@ -189,10 +189,6 @@ class ForumTopic < ApplicationRecord
|
||||
title.gsub(/\A\[APPROVED\]|\[REJECTED\]/, "")
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:creator, :updater, :forum_posts, :bulk_update_requests, :tag_aliases, :tag_implications]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:creator, :updater, :original_post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user