Created
July 2, 2018 12:11
-
-
Save groony/5fe0da8e91c201daa06b1e4c22401698 to your computer and use it in GitHub Desktop.
type validation
This file contains hidden or 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
schema = Dry::Validation.Schema(Dry::Validation::Schema::Params) do | |
required(:email).filled(:str?) | |
end | |
schema.(email: true).success? # => false | |
schema.(email: true).messages # => {:email=>["must be a string"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment