Skip to content

Commit b8d1737

Browse files
committed
feat(schema): change the way attributes are set by parseDynamo function
This does not change parseDynamo result 99% of the time, because `name` and `attr.name` are usually identical, but makes it possible to manually add hidden attributes to a schema by calling Attribute.create() with `name` set to Symbol(), which can be useful to plugin authors.
1 parent 1494f7c commit b8d1737

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Schema.prototype.parseDynamo = async function (model, dynamoObj) {
219219
attrVal = await attr.parseDynamo(dynamoObj[name]);
220220
}
221221
if (attrVal !== undefined && attrVal !== null) {
222-
model[name] = attrVal;
222+
model[attr.name] = attrVal;
223223
}
224224
} else {
225225
debug('parseDynamo: received an attribute name (%s) that is not defined in the schema', name);

0 commit comments

Comments
 (0)