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

@@ -4,7 +4,7 @@ class ArtistCommentaryVersion < ApplicationRecord
def self.search(params)
q = super
q = q.search_attributes(params, :post, :updater, :original_title, :original_description, :translated_title, :translated_description)
q = q.search_attributes(params, :original_title, :original_description, :translated_title, :translated_description)
q.apply_default_order(params)
end
@@ -42,6 +42,10 @@ class ArtistCommentaryVersion < ApplicationRecord
self[field].strip.empty? && (previous.nil? || previous[field].strip.empty?)
end
def self.searchable_includes
[:post, :updater]
end
def self.available_includes
[:post, :updater]
end