From 0530d5909e9ca420ac668fde858c7c56a85bdfe4 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Sat, 8 Apr 2017 13:58:05 +0530 Subject: [PATCH] fix(soft-deletes): pairs and ids ignore soft deleted Closes #109 --- src/Lucid/QueryBuilder/methods.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Lucid/QueryBuilder/methods.js b/src/Lucid/QueryBuilder/methods.js index 5001f182..b69c67cb 100644 --- a/src/Lucid/QueryBuilder/methods.js +++ b/src/Lucid/QueryBuilder/methods.js @@ -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) } } @@ -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