fixed issue with custom column name test failing

This commit is contained in:
Umed Khudoiberdiev 2017-05-13 18:02:59 +05:00
parent 72d24392a4
commit 96dca8410d
2 changed files with 4 additions and 4 deletions

View File

@ -351,7 +351,7 @@ export class ColumnMetadata {
// once we get nested embed object we get its column, e.g. post[data][information][counters][this.propertyName]
const embeddedObject = extractEmbeddedColumnValue(propertyNames, entity);
if (embeddedObject) {
if (this.relationMetadata && this.referencedColumn) {
if (this.relationMetadata && this.referencedColumn && this.isVirtual) {
const relatedEntity = this.relationMetadata.getEntityValue(embeddedObject);
return relatedEntity ? this.referencedColumn.getEntityValue(relatedEntity) : undefined;
} else {
@ -362,7 +362,7 @@ export class ColumnMetadata {
// return embeddedObject ? embeddedObject[this.propertyName] : undefined;
} else { // no embeds - no problems. Simply return column name by property name of the entity
if (this.relationMetadata && this.referencedColumn) {
if (this.relationMetadata && this.referencedColumn && this.isVirtual) {
const relatedEntity = this.relationMetadata.getEntityValue(entity);
return relatedEntity ? this.referencedColumn.getEntityValue(relatedEntity) : undefined;
} else {

View File

@ -214,7 +214,7 @@ describe("relations > custom-referenced-column-name", () => {
})));
it.skip("should persist relation when relation sets via join column", () => Promise.all(connections.map(async connection => {
it("should persist relation when relation sets via join column", () => Promise.all(connections.map(async connection => {
const category1 = new Category();
category1.name = "cars";
@ -450,7 +450,7 @@ describe("relations > custom-referenced-column-name", () => {
})));
it.skip("should persist relation when relation sets via join column", () => Promise.all(connections.map(async connection => {
it("should persist relation when relation sets via join column", () => Promise.all(connections.map(async connection => {
const tag1 = new Tag();
tag1.name = "tag #1";