Convert models to use new search includes mechanism
This commit is contained in:
@@ -18,7 +18,7 @@ class PostAppeal < ApplicationRecord
|
||||
module SearchMethods
|
||||
def search(params)
|
||||
q = super
|
||||
q = q.search_attributes(params, :creator, :post, :reason)
|
||||
q = q.search_attributes(params, :reason)
|
||||
q = q.text_attribute_matches(:reason, params[:reason_matches])
|
||||
|
||||
q = q.resolved if params[:is_resolved].to_s.truthy?
|
||||
@@ -54,6 +54,10 @@ class PostAppeal < ApplicationRecord
|
||||
creator.post_appeals.recent.count
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:creator, :post]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:creator, :post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user