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
Dynamic validation boundaries #281
Comments
I made two identical patches/commits, one is based on master (pull request made for this) and second one is based on latest tagged version. I'd be happy to provide also test for this but I was not able to run them on my linux box. Maybe you could provide some info on wiki how one should run tests. I'm getting a lot of errors (not failed test) running rake test (and rake test:ruby). This patch basically calls a Proc instance if specified in validation hash. I think it greatly extends functionality as I wrote in example in first comment. |
This allows ClientSideValidations to respect Proc parameters as ActiveModel does. I added also tests for new functionality. Missed only lenght test because rails does not allow Procs for LengthValidator
Hi,
I found one thing I'm missing. Imagine you have this validation in Value model that is limited by it's Boundary setting (another model)
validates :value, :numericality => { :less_than => Proc.new {|o| o.boundary.maximum } }
This Proc works great in rails but CSV probably expect just number in here. CSV should eval this Proc before using it. I think adding this won't be hard but I couldn't trace a right place to edit.
The text was updated successfully, but these errors were encountered: