AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
817 stars 312 forks source link

fix Ingredient Audio and Video boolean type casting #2909

Closed tvdeyen closed 1 month ago

tvdeyen commented 1 month ago

What is this pull request for?

Currently boolean values of ingredient video and audio are stored as strings ("0"/"1") in the data column JSON.

Cast to Boolean before we save to make this booleans.

Checklist

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.97%. Comparing base (87205af) to head (0ec35d5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2909 +/- ## ======================================= Coverage 95.96% 95.97% ======================================= Files 232 232 Lines 6273 6279 +6 ======================================= + Hits 6020 6026 +6 Misses 253 253 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mamhoff commented 1 month ago

What about the getters? Should those be overwritten, too, to make sure existing values in the database aren't strings/numbers?

tvdeyen commented 1 month ago

Thought about it, but current users will have their solution if they encounter the bug, and I didn't want to serialize twice for every website.

so, now people can pro actively change the values in the database by saving it once and we do not do more than necessary

alchemycms-bot commented 1 month ago

💚 All backports created successfully

Status Branch Result
✅ 7.0-stable
✅ 7.1-stable
✅ 7.2-stable

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details