Permalink
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...
1 parent b5f4f4b commit 87244a5982aac3ce25a7e54d64472d1532998dc2 mde committed Mar 11, 2013
Showing with 1 addition and 45 deletions.
  1. +0 −17 .gitignore
  2. +1 −1 lib/index.js
  3. +0 −27 test/validators.js
View
@@ -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
@@ -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
@@ -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;

0 comments on commit 87244a5

Please sign in to comment.