Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Fixes issue when using defineProperties we were passing the a…

…rray of properties instead of the property to the 'property' function"

This reverts commit 901a36e.
  • Loading branch information...
commit 87244a5982aac3ce25a7e54d64472d1532998dc2 1 parent b5f4f4b
mde authored
Showing with 1 addition and 45 deletions.
  1. +0 −17 .gitignore
  2. +1 −1  lib/index.js
  3. +0 −27 test/validators.js
View
17 .gitignore
@@ -1,17 +0,0 @@
-v8.log
-*.swp
-*.swo
-auth_info.js
-dist
-.idea/
-tags
-nbproject/
-spec/browser/autogen_suite.js
-node_modules
-tmtags
-*.DS_Store
-examples/*/log/*
-site/log/*
-.log
-npm-debug.log
-doc/
View
2  lib/index.js
@@ -839,7 +839,7 @@ model.ModelDefinitionBase = function (name) {
this.defineProperties = function (obj) {
for (var property in obj) {
- this.property(property, obj[property].type, obj[property]);
+ this.property(property, obj[property].type, obj);
}
}
View
27 test/validators.js
@@ -1,27 +0,0 @@
-var model = require('../lib')
- , assert = require('assert')
- , model = require('../lib')
- , tests;
-
-var ModelWithValidations = function () {
- this.defineProperties({
- requiredPropertyAddedByDefineProperties: {type: 'string', required: true},
- });
-
- this.property('requiredPropertyAddedByProperty', 'string', { required: true});
-};
-
-ModelWithValidations = model.register('ModelWithValidations', ModelWithValidations);
-
-tests = {
- 'Required option adds a validatesPresent rule when using defineProperties': function () {
- assert.ok(model.descriptionRegistry['ModelWithValidations'].properties.
- requiredPropertyAddedByDefineProperties.validations.present);
- }
-, 'Required option adds a validatesPresent rule when using property': function () {
- assert.ok(model.descriptionRegistry['ModelWithValidations'].properties.
- requiredPropertyAddedByProperty.validations.present);
- }
-};
-
-module.exports = tests;
Please sign in to comment.
Something went wrong with that request. Please try again.