-
Notifications
You must be signed in to change notification settings - Fork 34
Update project to remove isStatic flag #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There is no LB 3.0 version of loopback-workspace. We need the same version of loopback-workspace to support both LB 2.x and LB 3.x applications. |
@@ -18,9 +18,6 @@ | |||
"aliases": { | |||
"type": "array" | |||
}, | |||
"isStatic": { | |||
"type": "boolean" | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this property around, so that consumers of loopback-workspace do not need to understand how exactly are remote methods described in JSON files. That way the API of loopback-workspace remains the same, which means less work for us too.
475e51d
to
318f04b
Compare
@@ -2,6 +2,8 @@ | |||
// Node module: loopback-workspace | |||
// This file is licensed under the MIT License. | |||
// License text available at https://opensource.org/licenses/MIT | |||
var app = require('../../server/server'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Models in "common" should not depend on things in "server", that goes against the direction of dependencies. You can access the app via ModelMethod.app
after the model was configured (attached to a datasource & app).
4b495f3
to
6a7e8e3
Compare
result = {}; | ||
relatedData.forEach(function(related) { | ||
var key = related[relation.embed.key]; | ||
var Entity = require('loopback').getModel(relation.model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use app.models[relation.model]
to stay consistent with L65 above.
var keyFn = relation.embed.keyFn; | ||
if (keyFn && typeof Definition[keyFn] === 'function') { | ||
key = Definition[keyFn](related); | ||
var keySetter = relation.embed.keySetter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be keyGetter
, because we want to build a key from the data stored in our domain entity, shouldn't it?
01b66a0
to
007306b
Compare
@@ -128,12 +128,13 @@ module.exports = function(Definition) { | |||
fileData.name, embedId, config); | |||
} | |||
|
|||
config = Entity.getDataFromConfig(config); | |||
config = Entity.getDataFromConfig(config, embedId); | |||
|
|||
// add extra properties for relations | |||
config[relation.foreignKey] = fk; | |||
config[relation.embed.key] = embedId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to handle the case when relation.embed.key
is not defined, because there are embed.keySetter
and embed.keyGetter
instead.
@slnode test please |
1d3ee29
to
82fd603
Compare
amazon-0.12 is not failing after you restarted. The only thing failing now is generator-loopback and that's waiting to be fixed. |
Connect to https://github.com/strongloop-internal/scrum-loopback/issues/813
Only for LB 3.0