franckverrot / activevalidators

Collection of ActiveModel/ActiveRecord validators
https://rubygems.org/gems/activevalidators
MIT License
306 stars 49 forks source link

TLD support for url validator #100

Closed krachtstefan closed 6 years ago

krachtstefan commented 6 years ago

Thanks for this repo, it's a great validation resource!

I just have on suggestion. It would be great to make it possible to decide whether a url is allowed to have a tld or not.

http://localhost is a valid url for sure, but most user inputs should force a tld to prevent typos like http://mywebsitecom

Or is there already an option which I didn't notice?

franckverrot commented 6 years ago

Hi again, and thanks!

So no there isn't any option available right now to do what you suggest, but we coud build something.

Would you like to try submitting a PR and we could start the discussion from there? Or we could also discuss here and see what can be done for your use-case?

Thanks again!

krachtstefan commented 6 years ago

Thanks for your reply @franckverrot. I just made a pull request. I tried my best to make meaningful comments but don't hesitate to ask, if you have any questions.

franckverrot commented 6 years ago

Thanks, closing this in favor of the PR.