Removed normalization (see strong-remoting)

This commit is contained in:
Fabien Franzen 2014-08-04 12:17:06 +02:00
parent ef65ffee48
commit 81a822524d
2 changed files with 0 additions and 24 deletions

View File

@ -53,10 +53,6 @@ function isModelClass(cls) {
return cls.prototype instanceof DefaultModelBaseClass;
}
ModelBuilder.normalizePathName = function(pathName, className) {
return inflection.transform(pathName, ['underscore', 'dasherize']);
};
/**
* Get a model by name.
*
@ -116,11 +112,6 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
inflection.pluralize(className);
var pathName = (settings && settings.path) || pluralName;
var normalize = settings && settings.normalize;
if (this.normalizePathName || (normalize && this.normalizePathName !== false)) {
pathName = ModelBuilder.normalizePathName(pathName, className);
}
if (!className) {
throw new Error('Class name required');

View File

@ -556,21 +556,6 @@ describe('DataSource define model', function () {
User.http.path.should.equal('/accounts');
});
it('should normalize the remoting path - option', function () {
var ds = new DataSource('memory');
var User = ds.define('UserAccount', {name: String, bio: String}, { normalize: true });
User.http.path.should.equal('/user-accounts');
});
it('should normalize the remoting path - modelBuilder', function () {
var ds = new DataSource('memory');
ds.modelBuilder.normalizePathName = true;
var User = ds.define('UserAccount', {name: String, bio: String});
User.http.path.should.equal('/user-accounts');
});
});
describe('Load models with base', function () {