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

Commit 01dbaa5d by Jan Aagaard Meier

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

1 parent a6a8146c
Showing with 10 additions and 4 deletions
......@@ -10,6 +10,7 @@
- [FIXED] Include all with scopes [#4584](https://github.com/sequelize/sequelize/issues/4584)
- [INTERNALS] Corrected spelling seperate -> separate
- [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
- [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 = {
});
}
if (options.where) {
if (options.where && _.isPlainObject(options.where)) {
var attributes = options.where
, attribute
, rawAttribute;
......@@ -132,14 +132,19 @@ var Utils = module.exports = {
if (Array.isArray(attributes[attribute])) {
attributes[attribute] = attributes[attribute].map(function (where) {
return Utils.mapOptionFieldNames({
where: where
}, Model).where;
if (_.isPlainObject(where)) {
return Utils.mapOptionFieldNames({
where: where
}, Model).where;
}
return where;
});
}
}
}
}
return options;
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!