searchable: refactor searchable_includes.
Pass searchable associations directly to search_attributes instead of defining them separately in searchable_includes.
This commit is contained in:
@@ -30,7 +30,7 @@ class DtextLink < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.search(params)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :link_type, :link_target)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :link_type, :link_target, :model, :linked_wiki, :linked_tag)
|
||||
q.apply_default_order(params)
|
||||
end
|
||||
|
||||
@@ -48,10 +48,6 @@ class DtextLink < ApplicationRecord
|
||||
where(link_type: :wiki_link)
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:model, :linked_wiki, :linked_tag]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:model, :linked_wiki, :linked_tag]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user