mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
fixed issue with custom column name test failing
This commit is contained in:
parent
72d24392a4
commit
96dca8410d
@ -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 {
|
||||
|
||||
@ -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";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user