Model#search: factor out username search.

This commit is contained in:
evazion
2019-08-19 17:58:23 -05:00
parent 9a3e9747d8
commit c3ad7f6112
26 changed files with 41 additions and 189 deletions

View File

@@ -48,14 +48,7 @@ class Comment < ApplicationRecord
q = q.post_tags_match(params[:post_tags_match])
end
if params[:creator_name].present?
q = q.for_creator_name(params[:creator_name])
end
if params[:creator_id].present?
q = q.for_creator(params[:creator_id].to_i)
end
q = q.search_user_attribute(:creator, params)
q = q.attribute_matches(:is_deleted, params[:is_deleted])
q = q.attribute_matches(:is_sticky, params[:is_sticky])
q = q.attribute_matches(:do_not_bump_post, params[:do_not_bump_post])