search: refactor to pass in the current user explicitly.
This commit is contained in:
@@ -61,8 +61,8 @@ class WikiPage < ApplicationRecord
|
||||
order(updated_at: :desc)
|
||||
end
|
||||
|
||||
def search(params = {})
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :is_locked, :is_deleted, :body, :title, :other_names, :tag, :artist, :dtext_links)
|
||||
def search(params, current_user)
|
||||
q = search_attributes(params, [:id, :created_at, :updated_at, :is_locked, :is_deleted, :body, :title, :other_names, :tag, :artist, :dtext_links], current_user: current_user)
|
||||
q = q.where_text_matches([:title, :body], params[:title_or_body_matches])
|
||||
|
||||
if params[:title_normalize].present?
|
||||
|
||||
Reference in New Issue
Block a user