Skip to content

Allow nil on size and inclusion validations.#299

Merged
paulcsmith merged 7 commits intoluckyframework:masterfrom
wout:validations-with-allow-nil
Feb 9, 2020
Merged

Allow nil on size and inclusion validations.#299
paulcsmith merged 7 commits intoluckyframework:masterfrom
wout:validations-with-allow-nil

Conversation

@wout
Copy link
Contributor

@wout wout commented Feb 8, 2020

As suggested in #293, this PR adds an allow_nil option for validate_size_of and validate_inclusion_of.

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

A couple small comments. Thanks for doing this!

wout and others added 3 commits February 9, 2020 15:53
Co-Authored-By: Paul Smith <paulcsmith@users.noreply.github.com>
Co-Authored-By: Paul Smith <paulcsmith@users.noreply.github.com>
@wout
Copy link
Contributor Author

wout commented Feb 9, 2020

In this proposal, the original method keeps its original shape (more or less) and an overload is created specifically for the nil scenario.

@paulcsmith paulcsmith merged commit 7927e16 into luckyframework:master Feb 9, 2020
@wout wout deleted the validations-with-allow-nil branch February 9, 2020 19:51
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.

2 participants