search: refactor to pass in the current user explicitly.

This commit is contained in:
evazion
2022-09-22 04:16:28 -05:00
parent b56b6c554b
commit 88ac91f5f3
82 changed files with 233 additions and 280 deletions

View File

@@ -32,8 +32,8 @@ class ArtistCommentary < ApplicationRecord
where_text_matches(%i[original_title original_description translated_title translated_description], query)
end
def search(params)
q = search_attributes(params, :id, :created_at, :updated_at, :original_title, :original_description, :translated_title, :translated_description, :post)
def search(params, current_user)
q = search_attributes(params, [:id, :created_at, :updated_at, :original_title, :original_description, :translated_title, :translated_description, :post], current_user: current_user)
if params[:text_matches].present?
q = q.text_matches(params[:text_matches])