Permalink
Browse files

Updated docs, tests, template to use new lowercase names for datatypes.

  • Loading branch information...
1 parent d7f5ab3 commit 7f15377cfc512c1ee6ce1acceab904dcb8f5e77c @mde mde committed May 22, 2010
View
@@ -227,10 +227,10 @@ your app between client and server.
Here is an example of a model with some validations:
var User = function () {
- this.property('login', 'String', {required: true});
- this.property('password', 'String', {required: true});
- this.property('lastName', 'String');
- this.property('firstName', 'String');
+ this.property('login', 'string', {required: true});
+ this.property('password', 'string', {required: true});
+ this.property('lastName', 'string');
+ this.property('firstName', 'string');
this.validatesPresent('login');
this.validatesFormat('login', /[a-z]+/, {message: 'Subdivisions!'});
@@ -22,7 +22,7 @@ var requests = new function () {
this.idIncr = 0;
this.addRequest = function (param) {
- var reqId = new String(this.idIncr);
+ var reqId = String(this.idIncr);
this.outstanding[reqId] = {
method: param.method || 'GET',
url: param.url,
@@ -1,10 +1,10 @@
var <%= names.constructor.singular %> = function () {
/*
- this.property('login', 'String', {required: true});
- this.property('password', 'String', {required: true});
- this.property('lastName', 'String');
- this.property('firstName', 'String');
+ this.property('login', 'string', {required: true});
+ this.property('password', 'string', {required: true});
+ this.property('lastName', 'string');
+ this.property('firstName', 'string');
this.validatesPresent('login');
this.validatesFormat('login', /[a-z]+/, {message: 'Subdivisions!'});
@@ -1,9 +1,9 @@
var User = function () {
- this.property('login', 'String', {required: true});
- this.property('password', 'String', {required: true});
- this.property('lastName', 'String');
- this.property('firstName', 'String');
+ this.property('login', 'string', {required: true});
+ this.property('password', 'string', {required: true});
+ this.property('lastName', 'string');
+ this.property('firstName', 'string');
this.validatesPresent('login');
this.validatesFormat('login', /[a-z]+/, {message: 'Subdivisions!'});
@@ -1,9 +1,9 @@
var ByTor = function () {
- this.property('rush', 'Number');
+ this.property('rush', 'number');
this.property('flyByNight', 'int');
- this.property('caressOfSteel', 'Object');
- this.property('farewellToKings', 'Array');
+ this.property('caressOfSteel', 'object');
+ this.property('farewellToKings', 'array');
};
model.registerModel('ByTor');
@@ -65,7 +65,7 @@ var testDatatypes = new function () {
byTor = ByTor.create({caressOfSteel: []});
jum.assertNotUndefined(byTor.errors.caressOfSteel);
- // String, should fail
+ // string, should fail
byTor = ByTor.create({caressOfSteel: 'As gray traces of dawn ...'});
jum.assertNotUndefined(byTor.errors.caressOfSteel);
@@ -81,7 +81,7 @@ var testDatatypes = new function () {
byTor = ByTor.create({farewellToKings: {}});
jum.assertNotUndefined(byTor.errors.farewellToKings);
- // String, should fail
+ // string, should fail
byTor = ByTor.create({farewellToKings: 'As gray traces of dawn ...'});
jum.assertNotUndefined(byTor.errors.farewellToKings);

0 comments on commit 7f15377

Please sign in to comment.