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:
@@ -38,8 +38,7 @@ class PostVersion < ApplicationRecord
|
||||
end
|
||||
|
||||
def search(params)
|
||||
q = super
|
||||
q = q.search_attributes(params, :updater_id, :post_id, :tags, :added_tags, :removed_tags, :rating, :rating_changed, :parent_id, :parent_changed, :source, :source_changed, :version)
|
||||
q = search_attributes(params, :id, :updated_at, :updater_id, :post_id, :tags, :added_tags, :removed_tags, :rating, :rating_changed, :parent_id, :parent_changed, :source, :source_changed, :version)
|
||||
|
||||
if params[:changed_tags]
|
||||
q = q.changed_tags_include_all(params[:changed_tags].scan(/[^[:space:]]+/))
|
||||
|
||||
Reference in New Issue
Block a user