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

feature: Add enum support for column casting #89

Merged

Conversation

BadJacky
Copy link
Contributor

@BadJacky BadJacky commented Oct 28, 2024

I have addressed an issue where an error occurs when using #[Cast(EnumFQCN)] alongside validation to create data. After investigation, I found that the issue arises because the enum is not converted to its corresponding value during the validation process.
Changes:
● Modified the handling of #[Cast(EnumFQCN)] during the validation process to ensure that enums are correctly converted to their respective values.
Testing:
● Added comprehensive test cases to ensure the modified code works as expected in various scenarios.
● The tests cover different possible scenarios involving enums in the validation process, ensuring the correctness and stability of the conversion logic.
Notes:
● Please run the tests before merging to ensure all test cases pass.
● If there are any issues or further improvements are needed, please let me know.
Related Attachments:
CleanShot 2024-10-28 at 17 37 23@2x

Thank you for your review and feedback!

@BadJacky BadJacky force-pushed the feature/add-enum-cast-support branch 2 times, most recently from f639201 to 9c12844 Compare October 28, 2024 04:00
@BadJacky
Copy link
Contributor Author

BadJacky commented Oct 28, 2024

@WendellAdriel Please take a moment to review. If you have any questions or concerns, feel free to reach out to me. I appreciate your feedback and look forward to your input.

@BadJacky BadJacky changed the title feature: Add enum support for Article status and enhance validation l… feature: Add enum support for column casting Oct 28, 2024
@BadJacky BadJacky force-pushed the feature/add-enum-cast-support branch from 9c12844 to 10f601f Compare October 28, 2024 05:49
@BadJacky
Copy link
Contributor Author

** Generated by Copilot **
This pull request introduces support for handling enums in validation and casting, along with corresponding tests. The most important changes include adding an enumValue method to handle enum values, updating validation methods to utilize this new method, and adding new test cases to verify the functionality.

Enhancements to Enum Handling:

Test Additions:

Miscellaneous:

Copy link
Owner

@WendellAdriel WendellAdriel left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on reviewing this, I had a lot going on.
Thanks for the contribution, this is a great add to the package!
I'm going to merge and to release a new version!

@WendellAdriel WendellAdriel merged commit b600d95 into WendellAdriel:main Nov 5, 2024
5 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