From dfe898a329b7ffb75c61db9c2d6c05e4b547597c Mon Sep 17 00:00:00 2001 From: justin talbott Date: Wed, 19 Mar 2014 13:19:32 -0400 Subject: [PATCH] Allow to use data-validate without options --- app/assets/javascripts/judge.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/judge.js b/app/assets/javascripts/judge.js index 46ab313..d894cf1 100644 --- a/app/assets/javascripts/judge.js +++ b/app/assets/javascripts/judge.js @@ -189,6 +189,7 @@ this.attrValidators = root.JSON.parse(this.element.getAttribute('data-validate')); _.each(this.attrValidators, function(av) { + av.options = av.options || {}; if (this.element.value.length || av.options.allow_blank !== true) { var method = _.bind(judge.eachValidators[av.kind], this.element), validation = method(av.options, av.messages);