From 07e1090445bde3dcaf8cd133f41d183d18718ef6 Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Sun, 10 Jul 2016 14:20:16 -0400 Subject: [PATCH] Modify User#findByPhone to search for usages in both confirmed numbers and pending numbers --- src/main/java/net/frozenorb/apiv3/model/User.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/frozenorb/apiv3/model/User.java b/src/main/java/net/frozenorb/apiv3/model/User.java index 69b711f..8eda6de 100644 --- a/src/main/java/net/frozenorb/apiv3/model/User.java +++ b/src/main/java/net/frozenorb/apiv3/model/User.java @@ -84,7 +84,10 @@ public final class User { } public static void findByPhone(String phoneNumber, SingleResultCallback callback) { - usersCollection.find(new Document("phone", phoneNumber)).first(SyncUtils.vertxWrap(callback)); + usersCollection.find(new Document("$or", ImmutableList.of( + new Document("phone", phoneNumber), + new Document("pendingPhone", phoneNumber) + ))).first(SyncUtils.vertxWrap(callback)); } public static void findByEmail(String email, SingleResultCallback callback) {