From bb1bfdf2c40ee26f530839c2e227519b91019611 Mon Sep 17 00:00:00 2001 From: Abrar Arshad Date: Mon, 19 Feb 2018 23:57:44 +0300 Subject: [PATCH] patching attribute with oldValue as undefined --- src/decorators/attribute.decorator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decorators/attribute.decorator.ts b/src/decorators/attribute.decorator.ts index 0caeab58..b67e631c 100644 --- a/src/decorators/attribute.decorator.ts +++ b/src/decorators/attribute.decorator.ts @@ -57,7 +57,7 @@ export function Attribute(options: AttributeDecoratorOptions = {}): PropertyDeco instance[AttributeMetadata] = {}; } - const propertyHasDirtyAttributes = typeof oldValue === 'undefined' && !isNew ? false : hasDirtyAttributes; + const propertyHasDirtyAttributes = (oldValue === newValue) ? false : hasDirtyAttributes; instance[AttributeMetadata][propertyName] = { newValue,