client_side_validations 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,21 +8,20 @@ if (typeof(jQuery) != "undefined") {
|
|
8
8
|
clientSideValidations: function() {
|
9
9
|
var form = this;
|
10
10
|
var object = form.attr('object-csv');
|
11
|
-
var
|
11
|
+
var form_id = form[0].id;
|
12
12
|
var object_id = null;
|
13
13
|
var adapter = 'jquery.validate';
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
id = /edit_(\w+)_\d+/.exec(id)[1]
|
18
|
-
object_id = /edit_\w+_(\d+)/.exec(id)[1]
|
14
|
+
|
15
|
+
if (/edit/.test(form_id)) {
|
16
|
+
object_id = /edit_\w+_(\d+)/.exec(form_id)[1];
|
19
17
|
}
|
18
|
+
|
20
19
|
if (eval("typeof(" + object + "_validation_options)") != "undefined") {
|
21
20
|
var options = eval(object + '_validation_options');
|
22
21
|
} else {
|
23
22
|
var options = { }
|
24
23
|
}
|
25
|
-
var client = new ClientSideValidations(
|
24
|
+
var client = new ClientSideValidations(object, adapter, object_id)
|
26
25
|
var rules = eval(object + '_validation_rules');
|
27
26
|
var validations = client.adaptValidations(rules);
|
28
27
|
options['rules'] = validations.rules;
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 2.4.
|
8
|
+
- 1
|
9
|
+
version: 2.4.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brian Cardarella
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-11 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|