不要怂,就是干,撸起袖子干!

Commit 01dbaa5d by Jan Aagaard Meier

refactor(internals) Only recurse on plain object in mapOptionFieldNames. Closes #4596

1 parent a6a8146c
Showing with 7 additions and 1 deletions
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
- [FIXED] Include all with scopes [#4584](https://github.com/sequelize/sequelize/issues/4584) - [FIXED] Include all with scopes [#4584](https://github.com/sequelize/sequelize/issues/4584)
- [INTERNALS] Corrected spelling seperate -> separate - [INTERNALS] Corrected spelling seperate -> separate
- [ADDED] Added `include` and `exclude` to `options.attributes`. [#4074](https://github.com/sequelize/sequelize/issues/4074) - [ADDED] Added `include` and `exclude` to `options.attributes`. [#4074](https://github.com/sequelize/sequelize/issues/4074)
- [FIXED/INTERNALS] Only recurse on plain objects in `mapOptionFieldNames`. [#4596](https://github.com/sequelize/sequelize/issues/4596)
# 3.10.0 # 3.10.0
- [ADDED] support `search_path` for postgres with lots of schemas [#4534](https://github.com/sequelize/sequelize/pull/4534) - [ADDED] support `search_path` for postgres with lots of schemas [#4534](https://github.com/sequelize/sequelize/pull/4534)
......
...@@ -111,7 +111,7 @@ var Utils = module.exports = { ...@@ -111,7 +111,7 @@ var Utils = module.exports = {
}); });
} }
if (options.where) { if (options.where && _.isPlainObject(options.where)) {
var attributes = options.where var attributes = options.where
, attribute , attribute
, rawAttribute; , rawAttribute;
...@@ -132,14 +132,19 @@ var Utils = module.exports = { ...@@ -132,14 +132,19 @@ var Utils = module.exports = {
if (Array.isArray(attributes[attribute])) { if (Array.isArray(attributes[attribute])) {
attributes[attribute] = attributes[attribute].map(function (where) { attributes[attribute] = attributes[attribute].map(function (where) {
if (_.isPlainObject(where)) {
return Utils.mapOptionFieldNames({ return Utils.mapOptionFieldNames({
where: where where: where
}, Model).where; }, Model).where;
}
return where;
}); });
} }
} }
} }
} }
return options; return options;
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!