searchable: don't automatically include id, created_at, updated_at.

Don't make search methods on models call super in order to search
certain default attributes (id, created_at, updated_at). Simplifies some
magic.
This commit is contained in:
evazion
2020-12-16 22:00:22 -06:00
parent b0659eb76c
commit e771c0fca8
45 changed files with 51 additions and 121 deletions

View File

@@ -1289,14 +1289,14 @@ class Post < ApplicationRecord
end
def search(params)
q = super
q = q.search_attributes(
q = search_attributes(
params,
:rating, :source, :pixiv_id, :fav_count, :score, :up_score, :down_score, :md5, :file_ext,
:file_size, :image_width, :image_height, :tag_count, :has_children, :has_active_children,
:is_note_locked, :is_rating_locked, :is_status_locked, :is_pending, :is_flagged, :is_deleted,
:is_banned, :last_comment_bumped_at, :last_commented_at, :last_noted_at
:id, :created_at, :updated_at, :rating, :source, :pixiv_id, :fav_count,
:score, :up_score, :down_score, :md5, :file_ext, :file_size, :image_width,
:image_height, :tag_count, :has_children, :has_active_children,
:is_note_locked, :is_rating_locked, :is_status_locked, :is_pending,
:is_flagged, :is_deleted, :is_banned, :last_comment_bumped_at,
:last_commented_at, :last_noted_at, :uploader_ip_addr
)
if params[:tags].present?