Convert models to use new search includes mechanism
This commit is contained in:
@@ -16,7 +16,7 @@ class Note < ApplicationRecord
|
||||
def search(params)
|
||||
q = super
|
||||
|
||||
q = q.search_attributes(params, :post, :is_active, :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], index_column: :body_index)
|
||||
|
||||
q.apply_default_order(params)
|
||||
@@ -129,6 +129,10 @@ class Note < ApplicationRecord
|
||||
new_note.save
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:post]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user