Created
April 11, 2016 00:56
-
-
Save joevandyk/07ce4aaaed07544c3dc3dd9c2d8829ab to your computer and use it in GitHub Desktop.
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
module Types | |
include Dry::Types.module | |
Percentage = Strict::Decimal.constrained(gt: 0, lt: 1) | |
Quantity = Strict::Int.constrained(gt: 0) | |
end | |
class Tier < Dry::Types::Struct | |
attribute(:quantity, Types::Quantity) | |
attribute(:percentage, Types::Percentage) | |
end | |
form_schema = Dry::Validation.Form do | |
key(:quantity).required(Types::Quantity) | |
key(:percentage).required(Types::Percentage) | |
end | |
gems/dry-types-0.7.1/lib/dry/types/compiler.rb:15:in `visit': undefined method `visit_[:type, "string"]' for #<Dry::Types::Compiler:0x007f7d16496f98 @registry=Dry::Types> (NoMethodError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment