impress/app
Emi Matchu 39bed6b157 Make Item's update_cached_fields callback more reliable
In our tests, I discovered an unexpected behavior where calling
`item.swf_assets << swf_asset` wasn't updating computed fields
correctly.

This isn't something we actually do in-app, I think the modeling system
happened to trigger the callbacks in a way that still worked fine?

But I think this is a good idea for reliability, since caching is such
a notoriously difficult thing to get right anyway! And it makes our
tests simpler and clearer.

Specifically, `compatible_body_ids` references `swf_assets`, which, I'm
kinda surprised, *doesn't* include the newly-added asset yet when the
`ParentSwfAssetRelationship.after_save` hook runs while calling
`item.swf_assets << swf_asset`. Reloading it fixes this!
2024-11-19 14:26:06 -08:00
..
assets Add mode to keep labeled alt styles until they're all labeled 2024-10-22 16:39:25 -07:00
controllers Oops, fix sort order for alt styles 2024-11-15 20:28:38 -08:00
helpers Announcement about modeling being broken 2024-11-06 11:55:05 -08:00
javascript Move Alt Styles into /rainbow-pool URLs, say "Pet Styles" more in text 2024-10-11 15:37:37 -07:00
mailers/fundraising Move most fundraising files into a Fundraising module 2024-02-18 20:12:14 -08:00
models Make Item's update_cached_fields callback more reliable 2024-11-19 14:26:06 -08:00
services Oops, fix bug when loading species with no alt styles in the Studio 2024-11-14 19:03:06 -08:00
views Handle new colors/species in the Rainbow Pool 2024-11-15 19:56:07 -08:00