Skip to content

Commit

Permalink
Fixes #218
Browse files Browse the repository at this point in the history
  • Loading branch information
svobik7 committed Nov 11, 2020
1 parent 26529ea commit ee643d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/datx/src/helpers/model/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ export function isAttributeDirty<T extends PureModel>(model: T, key: keyof T): b
const fields: Record<string, IFieldDefinition> = getMeta(model, MetaModelField.Fields, {});
const field = fields[key as string];

if(field === undefined) {
return false;
}

const value = field.referenceDef ? mapItems(model[key], getModelRef) : model[key];
return !isSame(value, prevCommit[key as string]);
}
Expand Down

0 comments on commit ee643d3

Please sign in to comment.