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

Add more options to lenght validator #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivanxuu
Copy link

@ivanxuu ivanxuu commented Feb 18, 2016

PROBLEM: Current options for length are not enough. Maybe you need to
restrict the minimum lenght or be a exact value

SOLUTION: add all the options of rails length validator, not just
maximum. But keep the old behaviour for retrocompatybility if just a
number is passed to length.

  Examples:
    multilang :title, :length => 100  #define maximum length validator
    multilang :title, :length => {:maximum=>100}  #define maximum length validator
    multilang :title, :length => {:minimum=> 2,:maximum=>100}  #define min/max length validator
    multilang :title, :length => {:within=>2..100}  #define min/max length validator
    multilang :title, :length => {:is=> 10} #length is exactly 10

PROBLEM: Current options for length are not enough. Maybe you need to
restrict the minimum lenght or be a exact value

SOLUTION: add all the options of rails length validator, not just
maximum. But keep the old behaviour for retrocompatybility if just a
number is passed to length.

  Examples:
    multilang :title, :length => 100  #define maximal length validator
    multilang :title, :length => 100  #define maximum length validator
    multilang :title, :length => {:minimum=> 2,:maximum=>100}  #define min/max length validator
    multilang :title, :length => {:within=>2..100}  #define min/max length validator
    multilang :title, :length => {:is=> 10} #length is exactly 10
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.

1 participant