Convert models to use new search includes mechanism
This commit is contained in:
@@ -6,7 +6,7 @@ class NoteVersion < ApplicationRecord
|
||||
def self.search(params)
|
||||
q = super
|
||||
|
||||
q = q.search_attributes(params, :updater, :is_active, :post, :note_id, :x, :y, :width, :height, :body, :version)
|
||||
q = q.search_attributes(params, :is_active, :x, :y, :width, :height, :body, :version)
|
||||
q = q.text_attribute_matches(:body, params[:body_matches])
|
||||
|
||||
q.apply_default_order(params)
|
||||
@@ -71,6 +71,10 @@ class NoteVersion < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:updater, :note, :post]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:updater, :note, :post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user