-
-
Save kwando/ee9897b9c49cbfefe792e17d91ac4817 to your computer and use it in GitHub Desktop.
schema example ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Each user has his own set of categories and I need to validate that the category_id provided belongs to the author of the post. | |
new_post_schema = Dry::Validation.Schema{ | |
key(:author_id).required(:int?) | |
key(:category_id).required(:int?) | |
key(:title).required(:str?) | |
key(:body).required(:str?) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment