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

Length validation is broken for nil values #1

Closed
anthonator opened this issue Jan 17, 2018 · 2 comments
Closed

Length validation is broken for nil values #1

anthonator opened this issue Jan 17, 2018 · 2 comments

Comments

@anthonator
Copy link
Contributor

** (CaseClauseError) no case clause matching: :graphemes
     code: Services.Register.execute(command)
     stacktrace:
       (justify) lib/justify.ex:176: Justify.validate_length/3
       (primary_context) lib/primary_context/services/register.ex:26: PrimaryContext.Services.Register.validate_command/1
       (primary_context) lib/primary_context/services/register.ex:9: PrimaryContext.Services.Register.execute/1
       test/primary_context/lib/services/register_test.exs:30: (test)
@anthonator
Copy link
Contributor Author

Ecto seems to handle length validation of nil and empty binary values by skipping them. The convention is to use validate_required/3 instead.

@anthonator
Copy link
Contributor Author

Fixed by #2

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

No branches or pull requests

1 participant