solidusio / solidus_subscriptions

An extension to add subscriptions to your Solidus store.
BSD 3-Clause "New" or "Revised" License
48 stars 53 forks source link

Fix filtering by line item in admin #275

Closed nirebu closed 1 year ago

nirebu commented 1 year ago

Summary

Fixes #274

This PR fixes the above issue by changing how the admin scopes subscriptions tied to a particular variant, instead of having to hunt down the specific line item when filtering them.

This also restructures the query in the view to avoid N+1s. On a store with 100K subscriptions the query and relative map take ~30ms.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed (~cross them out~ if they are not):

chrean commented 1 year ago

Thank you @nirebu and @stefano-sarioli (and @kennyadsl )!