Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apidocs/describe-builtin-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ console.log('Generating API docs for LoopBack built-in models.');

var app = loopback();

app.dataSource('db', { connector: 'memory', defaultForType: 'db' });
app.dataSource('db', { connector: 'memory' });

var modelNames = [];
for (var key in loopback) {
Expand Down
6 changes: 6 additions & 0 deletions lib/services.template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' &&
(action.sharedMethod.aliases || []).forEach(function(alias) {
var aliasMethod = alias.split('.').join('$');

// this is to handle strong-remoting does not prepend prototype.
// back into prototype methods
if (action.sharedMethod.isStatic === false) {
aliasMethod = ['prototype', aliasMethod].join('$');
}

ngdocForMethod(modelName, aliasMethod, action); -%>
R[<%-: aliasMethod | q %>] = R[<%-: methodName | q %>];
<% }); // aliases.foreach
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"karma-mocha-reporter": "^1.1.5",
"karma-phantomjs-launcher": "^1.0.1",
"karma-requirejs": "^0.2.1",
"loopback": "^2.0",
"loopback-datasource-juggler": "^2.0",
"loopback": "^3.0",
"loopback-datasource-juggler": "^3.0",
"mocha": "~1.18.0",
"morgan": "^1.2",
"phantomjs-prebuilt": "^2.1.7",
Expand Down
2 changes: 1 addition & 1 deletion test.e2e/spec/services.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ define(['angular', 'given', 'util'], function(angular, given, util) {
'deleteById',
'removeById',
'count',
'prototype$patchAttributes',
'prototype$updateAttributes',
]);
});
Expand Down Expand Up @@ -854,7 +855,6 @@ define(['angular', 'given', 'util'], function(angular, given, util) {
app.models.Product.create({ name: 'p1' }, function(err, prod) {
if (err) return cb(err);
debug('Created product', prod);

prod.categories.create({ name: 'c1' }, function(err, cat) {
if (err) return cb(err);
debug('Created category', cat);
Expand Down
25 changes: 18 additions & 7 deletions test.e2e/test-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,28 @@ masterApp.post('/setup', function(req, res, next) {

lbApp = loopback();

lbApp.dataSource('db', { connector: 'memory', defaultForType: 'db' });
lbApp.dataSource('mail', { connector: 'mail', defaultForType: 'mail' });
lbApp.dataSource('db', { connector: 'memory' });
for (var m in initialModels) {
if (initialModels[m].base.modelName == 'PersistedModel')
lbApp.model(initialModels[m], { dataSource: 'db' });
}

for (var m in models) {
models[m].dataSource = 'db';
var model = initialModels[m];
lbApp.model(model || m, models[m]);
var model = null;
var options = models[m].options || {};
if (initialModels[m]) {
model = initialModels[m];
lbApp.model(model, extend({ dataSource: 'db' }, options));
} else {
model = lbApp.registry.createModel(
m,
models[m].properties || {},
options
);
lbApp.model(model, { dataSource: 'db' });
}
}

loopback.autoAttach();

if (enableAuth)
lbApp.enableAuth();

Expand Down