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

Move currently_valid_prices to a method #4073

Conversation

waiting-for-dev
Copy link
Contributor

Having currently_valid_prices as an association between Variant and
Price made it a source of inconsistencies with the undecorated
prices association:

Spree::Variant.new.tap do |v|
  v.currently_valid_prices << Spree::Price.new
end.prices.any? # => false

Note: Extraction from #3994

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

Having `currently_valid_prices` as an association between `Variant` and
`Price` made it a source of inconsistencies with the undecorated
`prices` association:

```
Spree::Variant.new.tap do |v|
  v.currently_valid_prices << Spree::Price.new
end.prices.any? # => false
```
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/move_currently_valid_to_a_price branch from 3730274 to 515fbe5 Compare May 21, 2021 13:21
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Makes sense

@kennyadsl kennyadsl merged commit 9d13705 into solidusio:master May 28, 2021
@kennyadsl kennyadsl deleted the waiting-for-dev/move_currently_valid_to_a_price branch May 28, 2021 09:41
@kennyadsl kennyadsl added the changelog:solidus_core Changes to the solidus_core gem label May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants