pools: allow searching pools by post id or post count.
All pools containing post #1: https://danbooru.donmai.us/pools?search[post_ids_include]=1 All pools containing either post #1 or #2: https://danbooru.donmai.us/pools?search[post_ids_include]=1,2 https://danbooru.donmai.us/pools?search[post_ids_include]=1+2 Pools with 1-100 posts: https://danbooru.donmai.us/pools?search[post_id_count]=1..100 Pools with no posts (empty pools): https://danbooru.donmai.us/pools?search[post_id_count]=0
This commit is contained in:
@@ -57,7 +57,7 @@ class Pool < ApplicationRecord
|
||||
def search(params)
|
||||
q = super
|
||||
|
||||
q = q.search_attributes(params, :creator, :is_active, :is_deleted, :name, :description)
|
||||
q = q.search_attributes(params, :creator, :is_active, :is_deleted, :name, :description, :post_ids)
|
||||
q = q.text_attribute_matches(:description, params[:description_matches])
|
||||
|
||||
if params[:name_matches].present?
|
||||
|
||||
Reference in New Issue
Block a user