Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[*] Resource Finder - Fix the record retrieval for a record having no belongsTo/hasOne for projects using Sequelize 4.8.x #134

Merged
merged 2 commits into from Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
### Fixed
- Resource Retrieval - Fix the record retrieval for a record having no belongsTo/hasOne for projects using Sequelize 4.8.x.

## RELEASE 1.3.6 - 2017-09-10
### Changed
Expand Down
6 changes: 5 additions & 1 deletion services/resource-finder.js
Expand Up @@ -18,7 +18,11 @@ function ResourceFinder(model, params, withIncludes) {
});
}
});
return includes;

// NOTICE: Avoid to inject an empty "include" array inside conditions
// otherwise Sequelize 4.8.x won't set the WHERE clause in the SQL
// query.
return includes.length === 0 ? null : includes;
}

this.perform = function () {
Expand Down