searchable: refactor searchable_includes.
Pass searchable associations directly to search_attributes instead of defining them separately in searchable_includes.
This commit is contained in:
@@ -19,7 +19,7 @@ class CommentVote < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.search(params)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :score)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :score, :comment, :user)
|
||||
q.apply_default_order(params)
|
||||
end
|
||||
|
||||
@@ -37,10 +37,6 @@ class CommentVote < ApplicationRecord
|
||||
score == -1
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:comment, :user]
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:comment, :user]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user