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

Restore behavior to always store unknown attributes in the database #169

Conversation

osanay
Copy link
Contributor

@osanay osanay commented Apr 25, 2024

Our application uses StoreModel with the serialize_unknown_attributes option set to false.

Previously, StoreModel versions prior to 2.1.1 always stored unknown attributes in the database. However, now, unknown attributes are not stored unless the serialize_unknown_attributes option is set to true. This change was inconvenient for us; therefore, we want to restore the behavior of storing unknown attributes in the database, regardless of the setting of the serialize_unknown_attributes option.

The fix was straightforward. Furthermore, to ensure this behavior does not break, I have improved the tests for the serialize method in each Type class.

However, this change will again alter the behavior of storing unknown attributes in the database. I considered adding an option to choose whether to store unknown attributes or not. The challenge, then, is deciding what the default value for this new option should be. Considering current users who have the serialize_unknown_attributes option enabled, the default should logically be to store. Ultimately, this would amount to a similar breaking change.

Nevertheless, it simply restores the behavior of the previous version.

osanay added 2 commits April 23, 2024 17:41
This commit reverts the behavior of always storing unknown attributes
in the database as it was in versions prior to 2.1.1, regardless of
the value of the `serialize_unknown_attributes` option.
…nknown attributes

This commit adds tests to each `Type` class's `serialize` method to
ensure that unknown attributes are included in the serialization
output, regardless of the `serialize_unknown_attributes` option.
@DmitryTsepelev
Copy link
Owner

LGTM! Maybe I'll just roll out a major release 🙂

@DmitryTsepelev DmitryTsepelev merged commit 5aedf27 into DmitryTsepelev:master Apr 26, 2024
16 checks passed
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.

2 participants