Commit graph

856 commits

Author SHA1 Message Date
Matchu
9de50deb3c Remove SWF conversion
We've already swapped out the backend for this stuff to Impress 2020, so the resque task and the broken image report UI aren't actually relevant anymore. Delete them!

This helps us delete Resque soon too.
2023-08-02 12:43:45 -07:00
Matchu
2de9e9f45a Stop caching trade users on item page
Idk this one might actually be a bit of a pain to load? But I'd want to optimize it differently anyway, and there's overhauls we're already planning to do here.
2023-08-02 12:29:34 -07:00
Matchu
caa0859a2d Stop caching pet type images on item page
That's easy queries and easy templates!
2023-08-02 12:22:39 -07:00
Matchu
99910aff6a Stop caching item page contributors
This lets us remove the contribution observer too!
2023-08-02 12:10:38 -07:00
Matchu
c9e00f1d7c Stop caching latest contribution
That's another tiny query that I'm okay with just removing the cache overhead complexity for right now!
2023-08-02 12:04:09 -07:00
Matchu
596c2a1320 Remove unused "outfits#new newest_items" cache
Huh! This cache key seemed to only be referenced in checks and expirations, but was never actually used! So I guess we've been loading the modeling predictions every time for a while huh??

We'll get smarter about that someday, but anyway, that lets us delete our Item resque tasks and ItemObserver!
2023-08-02 12:02:19 -07:00
Matchu
e9c16891c8 Remove newest_items caching from items page
Yeah I'm very unconvinced of the merit of saving us one items/translations query lmao
2023-08-02 11:47:03 -07:00
Matchu
3ea22e6977 Remove as_json item caching
Again I'm just not convinced of the perf on this, and it enables us to delete some whole infra over it, we can improve it another time if it's useful to!
2023-08-02 11:41:19 -07:00
Matchu
beb5c14d42 Simplify item page rendering
Just removing some caching and the expiration of it! There's still more superfluous(?) caching on the item page to audit, but these seem a bit more sensible about avoiding loading extra data.
2023-08-02 11:38:10 -07:00
Matchu
263670a013 Simplify item_link rendering
In the interest of clearing out Resque, I'm just gonna remove a lot of our more complex caching stuff, and we can do a perf pass for things like big item list pages once everything's upgraded. (I'm hopeful that the upgrades themselves improve perf; and if not, that some improved sensibilities 10 years later can find simpler approaches.)
2023-08-02 11:34:27 -07:00
Matchu
8c5335f018 Oops, remove some remaining references to Flex
We uninstalled Flex, our Elasticsearch gem, to replace item search with direct DB queries; but I forgot these calls, oops!

I also kinda want to see about deleting the resque tasks altogether, since I'm not sure how to get Resque installed on latest rails bc there seems to be a conflict over the version of Rack? And it'd be nice to get rid of the complexity if we can.
2023-08-02 11:18:37 -07:00
Matchu
47c7b6329f Reimplement Advanced Search
Oh I uhhh flat out forgot about this LMAO

well it's back now!! and was pleasantly easy to build, following the `from_text` example & abstractions
2023-07-29 13:14:23 -07:00
Matchu
578c59ce04 Oops, fix ambiguous zones_restrict column
When combining occupies and restricts filters, this wouldn't be sure whether to apply to the items or the swf assets.
2023-07-29 13:11:53 -07:00
Matchu
bc5241d087 Oops, add unowned & unwanted support to search!
Uhhh idk how I messed this up, but right, wanting is not the opposite of owning, LOL!
2023-07-29 13:10:18 -07:00
Matchu
5a362d8048 Fix item data not loading
Oops, finder options were removed! That's fine, the `:select` on here isn't useful anyway, and I'd rather just load everything and be simpler lol
2023-07-29 12:18:22 -07:00
Matchu
f3aef18e27 Convert has_many conditions to where block
Looks like `conditions` was removed in this version! This broke outfit saving. Now it's fixed!
2023-07-29 12:13:58 -07:00
Matchu
69c98ec35e Use all instead of scoped
Back in the day, `all` would immediately load up a query into an array, but now I think it's an alias for what `scoped` used to be: a relation that contains everything.
2023-07-29 12:06:26 -07:00
Matchu
df629368d3 Rename ClosetList.public -> publicly_visible
This removes a conflict with a new Rails method `.public` on the model!
2023-07-29 11:55:26 -07:00
Matchu
d1fbc1b178 Use strong parameters for ClosetHanger 2023-07-29 11:25:25 -07:00
Matchu
a2bd538bb4 Use strong parameters for ClosetList 2023-07-29 11:22:15 -07:00
Matchu
32b1608346 Drop NewsPosts model
We never ended up really using this lol, and it has an attr_accessible I want to be rid of so let's just fully trash it while we're at it!
2023-07-29 11:19:37 -07:00
Matchu
59580ab47b Use strong parameters for User 2023-07-29 11:07:14 -07:00
Matchu
4250e009d7 Use strong parameters for Outfit 2023-07-29 10:52:23 -07:00
Matchu
1ffcb59f4a Auto log in as test user in development mode
I want to test some logged-in stuff, but the whole openneo_id app is a mess to integrate with (and I want to eliminate it down the line anyway), so here's a simple hacky thing that just gets you into a test user for development!
2023-07-29 10:39:07 -07:00
Matchu
39a722600c Use strong parameters for Donation 2023-07-29 10:29:09 -07:00
Matchu
abf08bb7e7 Delete attr_accessible from Campaign
idk what these were even doing here, I never built a UI to edit campaigns?
2023-07-29 10:18:42 -07:00
Matchu
a0de57bed9 Backfill globalize's find_by_name method
This method was removed in globalize 4, which we upgraded to for compatibility with Rails 4! Let's add back in a similar thing for now!
2023-07-28 15:33:46 -07:00
Matchu
24511e5cfe Oops, fix item search crash in wardrobe
Oh right, these aren't the weird item proxy thing anymore, stop calling these methods!
2023-07-28 15:16:06 -07:00
Matchu
4b891b1a91 Improve zones.json performance
Idk I'm working on a mobile hotspot rn and not including the translations was making this slow, hey may as well fix while we're here right? lol
2023-07-28 15:08:54 -07:00
Matchu
ca6a573c0a Add user:owns/wants back to item search
Not so bad, using a condition on `has_many` `through` was a cute trick!!
2023-07-28 15:06:33 -07:00
Matchu
070599e2ca Add fits and not_fits back to item search
Some fun stuff here to figure out how to API this out well, but I'm pretty pleased with where it ended up!
2023-07-28 14:45:10 -07:00
Matchu
4ac1304c74 Improve not_occupied solution
Not being a subquery is better! I realized later that a LEFT JOIN would probably do it even betterer? with like `HAVING count(x) = 0`? but the `left_outer_joins` method doesn't seem to be in Rails 4, and I don't want to do stringy joins, so this is fine for now!
2023-07-28 14:10:13 -07:00
Matchu
ab015db461 Oops, fix not_occupies logic error
Right, previously we were querying "has *at least one asset* that is not in zone X" instead of "has NO assets that are in zone X".

I don't know a fast way to query for that, this will have to do for now!
2023-07-26 13:18:19 -07:00
Matchu
5c119abcd8 Add restricts filter back to item search 2023-07-26 12:41:37 -07:00
Matchu
db9e3dfb53 Add occupies filter back to item search
Mostly adapting what was already there!
2023-07-26 12:28:25 -07:00
Matchu
da508ab33a Use arel for item translation joins
Just a bit defensive so we aren't setting up the possibility of an ambiguous query someday!
2023-07-26 11:58:05 -07:00
Matchu
d12b21896c Add is:pb back to item search 2023-07-26 11:51:52 -07:00
Matchu
4d722dd5c5 Simplify filter API a bit
Not doing the tricks with `is_positive` anymore, instead just calling different functions altogether at the call site.

Also, instead of classes, I feel like this is a lot more concise to just write as class methods that create certain instances of a trivial `Filter` data class. Without the tricks of `is_positive` in play, the value of classes goes way down imo.
2023-07-26 11:47:00 -07:00
Matchu
2ac806333d Move Item name search logic to model scope 2023-07-26 11:15:35 -07:00
Matchu
c04bab55d0 Improve is:X failure message 2023-07-26 11:06:36 -07:00
Matchu
20bedf8f59 Start building new item search
Just name field right now, more to come! A lot deleted lol
2023-07-22 19:01:40 -07:00
Matchu
f997513e87 Update to new scope syntax
Ohh ok, without this change all of our `scope`s were just immediately evaluating the argument and fetching _all_ such matching records immediately, instead of waiting to actually be called. This led to bugs like `pet_type.as_json` returning ALL pet states in the whole db, because the `PetState.emotion_order` scope was being treated as a single predefined query, rather than a query fragment to merge into the current context.

This also explains what happened in 724ed83: that's why things before the scope in the query were being ignored.
2023-07-22 14:04:01 -07:00
Matchu
f234513976 Fix SASS @extend of non-existant class
This used to just be ignored, but SASS crashes on it now, reasonable ty!
2023-07-22 13:47:56 -07:00
Matchu
989d12050b Remove unused JSX pragma in modeling React code
lol again this is hard to test so uhh I hope this didn't break it all!! though tbh I feel like we removed this feature or something anyway? idk it stopped working in some way
2023-07-22 13:35:41 -07:00
Matchu
5d5830c3b1 Fix modeling_i18n_tag crash
Tbh I'm not 100% sure this is a fix, I'm not sure what `haml_concat` was doing here, and the page is still crashing so it's hard to say. But fingers crossed!
2023-07-22 13:34:08 -07:00
Matchu
724ed83833 Fix select bug in Item.all_by_ids_or_children
Idk why, but when the `select` was the first thing in the query, it was getting ignored. I wonder if there's something about the `object_assets` scope that I'm not understanding that's overwriting it? Or the `joins`? But whatever, this works, I'm not worried about it for now!
2023-07-22 13:32:29 -07:00
Matchu
a705bfc34e Fix caching crashes in localized_cache
The controller was like "oh yeah we have that cached" (from previous renders of the app on Rails 3 I think?), but the view disagreed, bc it was appending a template digest to the cache key. That's a smart feature, but not compatible with how we skip queries in the controller, so disable it for now!
2023-07-22 12:52:53 -07:00
Matchu
3020def570 Update to new set_table_name syntax 2023-07-22 12:36:04 -07:00
Matchu
8ce5fd7c3e Update syntax for set_inheritance_column 2023-07-22 12:23:14 -07:00
Matchu
7d20204940 Remove flex from the app (breaks search!)
We'll need to replace the item search query stuff with direct MySQL queries, but that's not ready yet bc the app still isn't booting, so we're committing this in a known broken state for now!
2023-07-22 12:18:53 -07:00