Draft
Conversation
We want to deprecate the soft-deleteability of prices. This adds a rake task to fully delete any prices that are soft-deletable.
This module is intended to allow us to drop soft-deletion from Spree::Price. The deprecation logic is quite a lot, so I've moved it into a module. I've had to decouple the default scope in Spree::SoftDeletable from Discard's API, because otherwise any invocation of the class this is included in spits out deprecation warnings. We don't want that for prices.
We don't want to be using Discard's API for prices internally.
For Solidus 4.7, we still want to allow soft-deleted prices to give developers a time window to actually delete those soft-deleted prices. From Solidus 5, this option will be removed, and support for soft-deleted prices will be gone. This changes the spec for the app configuration to use a pristine app configuration every time, ensuring that the configuration of the test app is not necessarily the same as the default configuration for new apps.
Products and variants both have scopes that query prices. For these scopes, ignore the `kept` default scopes if `Spree::Config.soft_deleted_prices` is false.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6428 +/- ##
==========================================
- Coverage 89.51% 89.30% -0.22%
==========================================
Files 981 912 -69
Lines 20502 18733 -1769
==========================================
- Hits 18353 16730 -1623
+ Misses 2149 2003 -146 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Soft-deleteable prices are an absolute nuisance to think about, so this creates a strategy for removing that concept. WIP still!
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: