From fe6264b20af818496198f2e13f74bcdc31fcf227 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 11 Nov 2023 08:13:07 -0800 Subject: [PATCH] Use an actual body with ID "0", instead of the string "all" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I changed my mind again! At first I wanted to make the special case clearer, and to be able to more strongly assert that the species is not null. But now I'm like… eh, there's code that references `body.id` that has no reason _not_ to work in the all-bodies case… let's just keep the types more consistent, I think. --- app/models/item.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/item.rb b/app/models/item.rb index 4cbcb324..18e9a5b2 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -526,7 +526,8 @@ class Item < ApplicationRecord # If there are no body-specific assets, return one appearance for them all. if swf_assets_by_body_id.empty? - return [Appearance.new(:all, swf_assets_for_all_bodies)] + body = Body.new(0, nil) + return [Appearance.new(body, swf_assets_for_all_bodies)] end # Otherwise, create an appearance for each real (nonzero) body ID. We don't