Add additional search options

This commit is contained in:
BrokenEagle
2020-07-19 03:56:59 +00:00
parent 3eb90105df
commit c9ba41a58e
6 changed files with 24 additions and 4 deletions

View File

@@ -9,9 +9,9 @@ class WikiPageVersion < ApplicationRecord
def search(params)
q = super
q = q.search_attributes(params, :is_locked, :is_deleted)
q = q.text_attribute_matches(:title, params[:title])
q = q.text_attribute_matches(:body, params[:body])
q = q.search_attributes(params, :title, :body, :other_names, :is_locked, :is_deleted)
q = q.text_attribute_matches(:title, params[:title_matches])
q = q.text_attribute_matches(:body, params[:body_matches])
q.apply_default_order(params)
end