lib/invisible_captcha/validator.rb in invisible_captcha-0.7.0 vs lib/invisible_captcha/validator.rb in invisible_captcha-0.8.0
- old
+ new
@@ -1,11 +1,8 @@
-require 'active_model/validator'
-
module InvisibleCaptcha
class InvisibleCaptchaValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if invisible_captcha?(record, attribute)
- record.errors.clear
record.errors[:base] = InvisibleCaptcha.error_message
end
end
private
\ No newline at end of file