Skip to content

Conversation

sumocoder
Copy link

No description provided.

Copy link
Collaborator

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

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

@sumocoder thanks a lot for this massive contribution 🙌!
I really appreciate you taking the time to not only add a new feature (custom validations) but also fixing the code and style.

I'd be happy to get this merged for next release if you're still willing to help.
I just need you to do the following:

  • Rebase from master, hopefully this will fix the tests as well
  • Have a look at my comment, it would be nice to allow passing a Proc or similar value to custom: option

when :max_length
raise InvalidParameterError, "Parameter cannot have length greater than #{value}" unless param.nil? || value >= param.length
when :custom
value.validate!(param)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we rely on the method call instead of validate!, then options[:custom] can also be a Proc or a lambda.

@iMacTia iMacTia added this to the v0.11.0 milestone Sep 20, 2018
@iMacTia iMacTia mentioned this pull request Sep 23, 2019
@iMacTia
Copy link
Collaborator

iMacTia commented Sep 23, 2019

Closing in favour of #53

@iMacTia iMacTia closed this Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants