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

Include Preference Handling as a Module #4015

Merged
merged 3 commits into from
Apr 1, 2021

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Mar 30, 2021

Description

This takes the work from #4013 and merges it to the main branch. I've removed the deprecation warnings and related specs.

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)

mamhoff added 3 commits March 30, 2021 16:00
We can't do this in Spree::Base as of Rails 6.1 as Rails 6.1 expects
there to always be a preferences column if one calls `serialize
:preferences, Hash`.

Only a few classes have that column. This moves the code from
Spree::Base into a module, and includes that in those classes that
actually have a preferences column.

There are no deprecations in this commit, as the deprecation work is
done on the v2.11 branch.
If you try accessing a calculator with preferences in the DB, and that
calculator hasn't seen the `serialize` call, Rails will try accessing
the preferences column directly and return a string :(
These methods aren't available automatically any longer, thanks to Rails
6.1. They actually weren't in the first place, because not every model
has a `preferences` column.
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍

@kennyadsl kennyadsl merged commit 7c86416 into solidusio:master Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants