Skip to content

Commit

Permalink
Enable ORM to accept attributes named 'length'
Browse files Browse the repository at this point in the history
Replace `_.each()` with `_.forIn()` to enable ORM to accept attributes named 'length'.

See balderdashy/sails#4353
  • Loading branch information
danielsharvey authored Apr 3, 2018
1 parent 87e1dd4 commit 9ff4085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/joins/detect-children-records.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = function detectChildrenRecords(primaryKeyAttr, records) {

// Process each key in the record and build up a child record that can
// then be nested into the parent.
_.each(record, function checkForChildren(val, key) {
_.forIn(record, function checkForChildren(val, key) {
// Check if the key can be split this on the special alias identifier '__' (two underscores).
var split = key.split('__');
if (split.length < 2) {
Expand Down

0 comments on commit 9ff4085

Please sign in to comment.