Removed normalization (see strong-remoting)
This commit is contained in:
parent
ef65ffee48
commit
81a822524d
|
@ -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');
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue