searchable: refactor searchable_includes.
Pass searchable associations directly to search_attributes instead of defining them separately in searchable_includes.
This commit is contained in:
@@ -182,7 +182,7 @@ class Upload < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.search(params)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :source, :rating, :parent_id, :server, :md5, :server, :file_ext, :file_size, :image_width, :image_height, :referer_url)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :source, :rating, :parent_id, :server, :md5, :server, :file_ext, :file_size, :image_width, :image_height, :referer_url, :uploader, :post)
|
||||
|
||||
if params[:source_matches].present?
|
||||
q = q.where_like(:source, params[:source_matches])
|
||||
@@ -223,10 +223,6 @@ class Upload < ApplicationRecord
|
||||
artist_commentary_title.present? || artist_commentary_desc.present? || translated_commentary_title.present? || translated_commentary_desc.present?
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:uploader, :post]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:uploader, :post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user