Allow modeling pets for colors we haven't gotten metadata for yet

This used to be the behavior, and the site has plenty of graceful
fallbacks for it, I just forgot this one when doing Rails upgrades!

Note that the impress-2020 stuff is *not* as graceful about this, so
the wardrobe page won't show the pet until the color is in the DB. Ah
well, still an improvement!
This commit is contained in:
Emi Matchu 2024-02-16 23:22:41 -08:00
parent e9b0fa0779
commit 7a9ab64d75

View file

@ -86,8 +86,8 @@ class Pet < ApplicationRecord
def wardrobe_query
{
name: self.name,
color: self.pet_type.color.id,
species: self.pet_type.species.id,
color: self.pet_type.color_id,
species: self.pet_type.species_id,
pose: self.pet_state.pose,
state: self.pet_state.id,
objects: self.items.map(&:id),