Convert models to use new search includes mechanism
This commit is contained in:
@@ -56,7 +56,7 @@ class PostFlag < ApplicationRecord
|
||||
def search(params)
|
||||
q = super
|
||||
|
||||
q = q.search_attributes(params, :post, :is_resolved, :reason)
|
||||
q = q.search_attributes(params, :is_resolved, :reason)
|
||||
q = q.text_attribute_matches(:reason, params[:reason_matches])
|
||||
|
||||
if params[:creator_id].present?
|
||||
@@ -129,6 +129,10 @@ class PostFlag < ApplicationRecord
|
||||
post.uploader_id
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:post]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user