Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6585 Refactor work_info partials for emails to use tag_groups #4985

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sarken
Copy link
Collaborator

@sarken sarken commented Dec 10, 2024

Issue

https://otwarchive.atlassian.net/browse/AO3-6585

Purpose

Make the work_info partials more performant before we start using them for subscription emails. To quote this comment on an old subscription i18n PR:

The thing that stood out to me when I read the code is that the various *_string methods [currently used by the subscription email] use the tags association, so you only need a single database query for all of them (more or less). Whereas the work_info partial uses the individual ratings, categories, etc. associations, each of which is a separate ActiveRecord CollectionProxy that must be loaded with its own database query. I thought it was one database query per tag type, but it turns out it's three.

So this changes to tag_groups to reduce the number of database queries, as suggested in this comment on the issue.

Testing Instructions

Refer to Jira, but basically, we need to make sure gift notifications still work and look normal.

References

In the text above!

Credit

Sarken, she/her

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants