Convert models to use new search includes mechanism
This commit is contained in:
@@ -20,7 +20,7 @@ class PostVote < ApplicationRecord
|
||||
|
||||
def self.search(params)
|
||||
q = super
|
||||
q = q.search_attributes(params, :post, :user, :score)
|
||||
q = q.search_attributes(params, :score)
|
||||
q.apply_default_order(params)
|
||||
end
|
||||
|
||||
@@ -50,6 +50,10 @@ class PostVote < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:user, :post]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:user, :post]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user