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

Restrict validate_size_of to string attributes #579

Conversation

matthewmcgarvey
Copy link
Member

Fixes #570

I have seen validate_size_of mistakenly used to validate a numeric value since the name doesn't give any indication that the implementation expects strings. As the connected issue points out, even the documentation seems confused.

This change updates the type signature to allow only attributes that contains strings. While the type signature says it only takes in Avram::Attribute(String?), I found it also handles Avram::Attribute(String). I didn't expect it to be that smart 😄

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup 👍 I've updated the docs on the website already that reflect this change.

@matthewmcgarvey matthewmcgarvey merged commit be876ef into luckyframework:master Dec 29, 2020
@matthewmcgarvey matthewmcgarvey deleted the matthewmcgarvey/issue570 branch December 29, 2020 16:44
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

Successfully merging this pull request may close these issues.

validate_size_of implementation is confused
2 participants