Commit graph

22 commits

Author SHA1 Message Date
f6f618c9d5 Add Item.is{_not}_modeled scopes, for use in search later
We're now caching `predicted_fully_modeled?` on the database record, so
we can query by it in the database!

I'm moving on from the model I did in Impress 2020, of writing really
big fancy single-source-of-truth queries based on the assets themselves.

I see the merit of that in terms of theoretical reliability, but in
practice I think it will be *more* reliable to have one *in-code*
definition of modeling status (which we need anyway for generating the
homepage modeling requests), and just save that in a queryable way.
2024-11-19 15:52:52 -08:00
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
af5187edb6 Refactor item modeling spec, in anticipation of Item.is_modeled tests
I'm grouping some shared behaviors to pull into the different cases, so
that we can check the behaviors of a fully-modeled item vs a
not-fully-modeled item in *all* of the relevant cases.

Specifically, I'm planning to add `is:modeled` search filters, and
creating pending placeholder tests for them!
2024-11-19 13:44:31 -08:00
21eaf7b266 Fix silly variable scoping issue in item spec
Oh right, `@remote_id` is an instance variable so we can auto-increment
it over time, but `url` is just a derived value, and can just be local!
Silly!
2024-11-19 13:32:47 -08:00
91851bc340 Add tests for Maraquan item modeling predictions
I also added a test I forgot for the standard case: when you've modeled
each individual species.
2024-11-19 13:31:34 -08:00
3e7d27eaa3 Add a reminder to write modeling prediction tests for special colors 2024-11-19 12:18:17 -08:00
f7109e398a Better handle modeling predictions for items with *no* data
This doesn't generally happen, but did the other day when I rolled back
some of the database's SWF asset records but kept the items—and it was
a bit confusing that the homepage marked them as fully modeled!
2024-11-19 12:15:21 -08:00
f90380c4e6 Add tests for item modeling predictions
The stuff on the homepage! I'm also thinking about how to use these for
better discovery of items that need more modeling.
2024-11-19 12:10:49 -08:00
13371e3cf2 Remove unused automated testing files & gems
Look, I'll be real, I have literally not run these automated tests in
probably like a whole decade. Most of these files are empty, the ones
that aren't seem basically trivial, and I bet half of it would fail
anyway.

If I wanted to do real automated testing, I would basically want to
start from scratch anyway, and apply coverage I can trust to the areas
I actually care about.

Until then, I feel like these gems and files are mostly just clutter,
and I don't like them being One More Barrier To Entry. Goodbye, unused
complexity!
2023-10-25 16:09:01 -07:00
c93066e679 is:pb filter for deluxe paint brush items 2010-10-03 20:14:48 -04:00
531aac6523 upgrade to rails 3, make item tests pass 2010-10-03 19:50:32 -04:00
844be37abe is:nc filter 2010-07-10 12:42:18 -04:00
10f6d721e1 add only:species filter 2010-06-08 17:25:27 -04:00
7a32b9c894 both items, pet types own assets 2010-05-16 20:45:30 -04:00
66c43e220a move species supported images for item show into pet_type method 2010-05-16 16:15:21 -04:00
230026597b groundwork for preview, swf asset and relationship model 2010-05-16 15:01:38 -04:00
fd61838946 add error for invalid species in search 2010-05-15 18:23:23 -04:00
1de7df3c4a restrict search filters to description, species 2010-05-15 15:00:53 -04:00
80b1bf7c61 modify search behavior - require 3 characters, remove description searches to description: filter, consider items with no species support IDs to support all 2010-05-15 14:56:21 -04:00
ae09fe0515 item search throws exception if not given query 2010-05-15 13:28:34 -04:00
5b86e640b0 negate search conditions 2010-05-15 12:43:54 -04:00
851aa49091 basic specs for items, including search 2010-05-15 11:38:45 -04:00