search: refactor to pass in the current user explicitly.
This commit is contained in:
@@ -39,8 +39,8 @@ class PostVersion < ApplicationRecord
|
||||
where_ilike(:tags, tag)
|
||||
end
|
||||
|
||||
def search(params)
|
||||
q = search_attributes(params, :id, :updated_at, :updater_id, :post_id, :tags, :added_tags, :removed_tags, :rating, :rating_changed, :parent_id, :parent_changed, :source, :source_changed, :version)
|
||||
def search(params, current_user)
|
||||
q = search_attributes(params, [:id, :updated_at, :updater_id, :post_id, :tags, :added_tags, :removed_tags, :rating, :rating_changed, :parent_id, :parent_changed, :source, :source_changed, :version], current_user: current_user)
|
||||
|
||||
if params[:changed_tags]
|
||||
q = q.changed_tags_include_all(params[:changed_tags].scan(/[^[:space:]]+/))
|
||||
|
||||
Reference in New Issue
Block a user