Changed options.path to option.http.path

This commit is contained in:
Fabien Franzen 2014-08-04 19:45:47 +02:00
parent 81a822524d
commit 93aea7eb66
2 changed files with 5 additions and 2 deletions

View File

@ -111,7 +111,8 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
var pluralName = (settings && settings.plural) ||
inflection.pluralize(className);
var pathName = (settings && settings.path) || pluralName;
var httpOptions = (settings && settings.http) || {};
var pathName = httpOptions.path || pluralName;
if (!className) {
throw new Error('Class name required');

View File

@ -552,7 +552,9 @@ describe('DataSource define model', function () {
it('should allow an explicit remoting path', function () {
var ds = new DataSource('memory');
var User = ds.define('User', {name: String, bio: String}, { path: 'accounts' });
var User = ds.define('User', {name: String, bio: String}, {
http: { path: 'accounts' }
});
User.http.path.should.equal('/accounts');
});