Refactor searching text attributes.
* Allow using ApplicationRecord#attribute_matches to search text attributes, and standardize models on using this instead of duplicating code. * Remove restrictions that limited wildcard searches to Builders only in various places.
This commit is contained in:
@@ -56,6 +56,8 @@ class ModAction < ApplicationRecord
|
||||
def self.search(params)
|
||||
q = super
|
||||
|
||||
q = q.attribute_matches(:description, params[:description_matches])
|
||||
|
||||
if params[:creator_id].present?
|
||||
q = q.where("creator_id = ?", params[:creator_id].to_i)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user