From 93aea7eb66095073160480014f6ebe164fb9e29d Mon Sep 17 00:00:00 2001 From: Fabien Franzen Date: Mon, 4 Aug 2014 19:45:47 +0200 Subject: [PATCH] Changed options.path to option.http.path --- lib/model-builder.js | 3 ++- test/loopback-dl.test.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/model-builder.js b/lib/model-builder.js index 3aca2861..aa052dea 100644 --- a/lib/model-builder.js +++ b/lib/model-builder.js @@ -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'); diff --git a/test/loopback-dl.test.js b/test/loopback-dl.test.js index 14f45c16..8a63a249 100644 --- a/test/loopback-dl.test.js +++ b/test/loopback-dl.test.js @@ -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'); });