search: refactor to pass in the current user explicitly.
This commit is contained in:
@@ -102,8 +102,8 @@ class UserUpgrade < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.search(params)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :upgrade_type, :status, :transaction_id, :payment_processor, :recipient, :purchaser)
|
||||
def self.search(params, current_user)
|
||||
q = search_attributes(params, [:id, :created_at, :updated_at, :upgrade_type, :status, :transaction_id, :payment_processor, :recipient, :purchaser], current_user: current_user)
|
||||
|
||||
if params[:is_gifted].to_s.truthy?
|
||||
q = q.gifted
|
||||
|
||||
Reference in New Issue
Block a user