Changed options.path to option.http.path
This commit is contained in:
parent
81a822524d
commit
93aea7eb66
|
@ -111,7 +111,8 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
||||||
var pluralName = (settings && settings.plural) ||
|
var pluralName = (settings && settings.plural) ||
|
||||||
inflection.pluralize(className);
|
inflection.pluralize(className);
|
||||||
|
|
||||||
var pathName = (settings && settings.path) || pluralName;
|
var httpOptions = (settings && settings.http) || {};
|
||||||
|
var pathName = httpOptions.path || pluralName;
|
||||||
|
|
||||||
if (!className) {
|
if (!className) {
|
||||||
throw new Error('Class name required');
|
throw new Error('Class name required');
|
||||||
|
|
|
@ -552,7 +552,9 @@ describe('DataSource define model', function () {
|
||||||
it('should allow an explicit remoting path', function () {
|
it('should allow an explicit remoting path', function () {
|
||||||
var ds = new DataSource('memory');
|
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');
|
User.http.path.should.equal('/accounts');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue