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:
@@ -20,6 +20,8 @@ class WikiPageVersion < ApplicationRecord
|
||||
q = q.where("wiki_page_id = ?", params[:wiki_page_id].to_i)
|
||||
end
|
||||
|
||||
q = q.attribute_matches(:title, params[:title])
|
||||
q = q.attribute_matches(:body, params[:body])
|
||||
q = q.attribute_matches(:is_locked, params[:is_locked])
|
||||
q = q.attribute_matches(:is_deleted, params[:is_deleted])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user