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

Seems like size?(range) doesn't work #27

Closed
maxd opened this issue Dec 7, 2015 · 3 comments
Closed

Seems like size?(range) doesn't work #27

maxd opened this issue Dec 7, 2015 · 3 comments
Labels

Comments

@maxd
Copy link

maxd commented Dec 7, 2015

I have the following validator:

key(:region_iso_code) { |v| v.str? && v.size?(1..3) }

it raise the following error:

{:region_iso_code=>[["region_iso_code length must be within 1 - 3", "MOS"]]}

As you can see the input value MOS doesn't pass validation. Is it bug?

@solnic
Copy link
Member

solnic commented Dec 7, 2015

It's a bug in the form of a missing feature that I thought was done 😂 looks like size? predicate doesn't really support ranges. I'll fix it tomorrow and push 0.3.1 :)

@solnic solnic added the bug label Dec 7, 2015
@solnic solnic closed this as completed in ddd86a8 Dec 8, 2015
@maxd
Copy link
Author

maxd commented Dec 8, 2015

Checked. All works fine. Thank you! 👍

@solnic
Copy link
Member

solnic commented Dec 8, 2015

@maxd ah thanks for testing it :) I'll push 0.3.1 later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants