use proto() not prototype (#6474)

This commit is contained in:
Matthew Irish 2019-03-26 10:13:09 -05:00 committed by GitHub
parent f879599811
commit 1ac6046a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -38,10 +38,11 @@ export default Service.extend({
getNewModel(modelType, owner, backend) {
let name = `model:${modelType}`;
let newModel = owner.factoryFor(name).class;
if (newModel.merged || newModel.prototype.useOpenAPI !== true) {
let modelProto = newModel.proto();
if (newModel.merged || modelProto.useOpenAPI !== true) {
return resolve();
}
let helpUrl = newModel.prototype.getHelpUrl(backend);
let helpUrl = modelProto.getHelpUrl(backend);
return this.getProps(helpUrl, backend).then(props => {
if (owner.hasRegistration(name) && !newModel.merged) {