searchable: refactor searchable_includes.

Pass searchable associations directly to search_attributes instead of
defining them separately in searchable_includes.
This commit is contained in:
evazion
2020-12-16 22:43:18 -06:00
parent e771c0fca8
commit ee4516f5fe
38 changed files with 46 additions and 185 deletions

View File

@@ -155,7 +155,6 @@ module Searchable
indifferent_params = params.try(:with_indifferent_access) || params.try(:to_unsafe_h)
raise ArgumentError, "unable to process params" if indifferent_params.nil?
attributes += searchable_includes
attributes.reduce(all) do |relation, attribute|
relation.search_attribute(attribute, indifferent_params, CurrentUser.user)
end