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

Add the ability to validate data and lazy serialization #12

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

afuno
Copy link
Member

@afuno afuno commented Apr 30, 2024

No description provided.

A new Form class is introduced in Datory::Attributes, containing methods related to data serialization and validation. Callable module is updated to include a form method, which instantiates a new Form object. Product spec is also updated to add test cases for this functionality, checking validity and serialization of data.
@afuno afuno added the feature label Apr 30, 2024
@afuno afuno added this to the v1.0.0 milestone Apr 30, 2024
@afuno afuno self-assigned this Apr 30, 2024
afuno added 3 commits April 30, 2024 17:57
In this commit, additional tests were added to validate and serialize instances of User and Product classes. The tests are designed to account for valid and invalid data, handling both single and multiple instances.
The commit adds memoization to the serialization process of model in the form attribute. This will prevent unnecessary serialization if the model doesn't change, improving the efficiency of the code.
The 'invalid?' method has been introduced to form.rb, serving as a counterpart to the 'valid?' method. respective tests have also been added in user_spec.rb and product_spec.rb to ensure it functions correctly.
@afuno afuno marked this pull request as ready for review April 30, 2024 11:03
The README.md file has been updated to include details and examples for using the `UserDto.form(...)` method for serialization. This new function prepares a `Form` object, providing additional methods such as `valid?` and `invalid?`.
@afuno afuno merged commit aa228b2 into main Apr 30, 2024
26 checks passed
@afuno afuno deleted the features/SRV-95/form branch April 30, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant