Skip to content

Commit

Permalink
fix(soft-deletes): pairs and ids ignore soft deleted
Browse files Browse the repository at this point in the history
Closes #109
  • Loading branch information
thetutlage committed Jul 16, 2017
1 parent 9b6b81b commit 0530d59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Lucid/QueryBuilder/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ methods.scope = function (target) {
*/
methods.ids = function (target) {
return function () {
const serializer = new target.HostModel.QuerySerializer(target, this)
serializer._decorateQuery()
return target.modelQueryBuilder.select(target.HostModel.primaryKey).pluck(target.HostModel.primaryKey)
}
}
Expand All @@ -465,6 +467,8 @@ methods.ids = function (target) {
*/
methods.pair = function (target) {
return function (lhs, rhs) {
const serializer = new target.HostModel.QuerySerializer(target, this)
serializer._decorateQuery()
return target.modelQueryBuilder.select(lhs, rhs).reduce(function (result, row) {
result[row[lhs]] = row[rhs]
return result
Expand Down

0 comments on commit 0530d59

Please sign in to comment.