Closed Koroeskohr closed 8 years ago
This error comes from your before:
and after:
lambdas.
Using a lambda means that any the number of arguments you've specified is enforced with an exception.
The date validator passes an argument to these when it calls them, which is what's causing your error.
To fix the error, change your lambda
s to proc
s to ignore the argument silently.
The documentation in the README would then be the issue here :
class Article
validates :slug, :slug => true
validates :expiration_date, :date => {
:after => lambda { Time.now },
:before => lambda { Time.now + 1.year }
}
end
Using Ruby 2.3.1, Rails 4.2.6, ActiveValidators 4.0.0
I have a
PressRelease
model that has adatetime
field,released_at
. When using ActiveAdmin's datepicker, my date validation (that looks like this : )breaks and throws an
ArgumentError : wrong number of arguments (given 1, expected 0)
.I also use the URL validation, no problem with this one.
Full trace : trace.txt