From 61a4dcad02ce49025ab8cd1b932202b92419c851 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sun, 25 Feb 2024 14:47:37 -0800 Subject: [PATCH] Oops, "fits:blue-acara" search should return non-body-specific items Idk when this regressed exactly, but probably people didn't super notice because I don't think it's a very common thing to type directly into the Infinite Closet search box! (It used to be crucial to the old wardrobe app.) But I'm using it in the wardrobe app again now, so, fixed! --- app/models/item.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/item.rb b/app/models/item.rb index e31d5356..4b92f88c 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -87,8 +87,7 @@ class Item < ApplicationRecord where("NOT (#{condition})", *zone_ids) } scope :fits, ->(body_id) { - sa = SwfAsset.arel_table - joins(:swf_assets).where(sa[:body_id].eq(body_id)).distinct + joins(:swf_assets).where(swf_assets: {body_id: [body_id, 0]}).distinct } scope :not_fits, ->(body_id) { i = Item.arel_table