Convert models to use new search includes mechanism

This commit is contained in:
BrokenEagle
2020-07-19 03:42:51 +00:00
parent c141a358bd
commit c4009efccd
36 changed files with 208 additions and 125 deletions

View File

@@ -32,7 +32,7 @@ class UserFeedback < ApplicationRecord
def search(params)
q = super
q = q.search_attributes(params, :user, :creator, :category, :body, :is_deleted)
q = q.search_attributes(params, :category, :body, :is_deleted)
q = q.text_attribute_matches(:body, params[:body_matches])
q.apply_default_order(params)
@@ -65,6 +65,10 @@ class UserFeedback < ApplicationRecord
Dmail.create_automated(:to_id => user_id, :title => "Your user record has been updated", :body => body)
end
def self.searchable_includes
[:creator, :user]
end
def self.available_includes
[:creator, :user]
end