From d8eedc59b8627deec1247a431c6721d9bc58e0da Mon Sep 17 00:00:00 2001 From: James Simone <16430727+jamessimone@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:05:40 -0400 Subject: [PATCH] Fixes failing tests --- force-app/repository/Query.cls | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/force-app/repository/Query.cls b/force-app/repository/Query.cls index 6df1c13..c07bf55 100644 --- a/force-app/repository/Query.cls +++ b/force-app/repository/Query.cls @@ -35,11 +35,7 @@ public virtual class Query { return new ParentQuery(parentFields, this.operator, this.predicate); } - public static Query subquery( - Schema.SObjectField field, - Schema.SObjectField innerMatchingField, - Query subcondition - ) { + public static Query subquery(Schema.SObjectField field, Schema.SObjectField innerMatchingField, Query subcondition) { return subquery(field, innerMatchingField.getDescribe().getSObjectType(), innerMatchingField, subcondition); } @@ -107,9 +103,10 @@ public virtual class Query { String builtUpFieldName = ''; for (Integer index = 0; index < parentFields.size(); index++) { Schema.DescribeFieldResult parentFieldDescribe = parentFields[index].getDescribe(); - builtUpFieldName += index == parentFields.size() - 1 - ? parentFieldDescribe.getName() - : parentFieldDescribe.getRelationshipName() ?? parentFieldDescribe.getName().replace('__c', '__r') + '.'; + builtUpFieldName += + index == parentFields.size() - 1 + ? parentFieldDescribe.getName() + : (parentFieldDescribe.getRelationshipName() ?? parentFieldDescribe.getName().replace('__c', '__r')) + '.'; } return builtUpFieldName; } @@ -320,8 +317,8 @@ public virtual class Query { String innerString = this.getSoslPredicate(innerPred); innerStrings.add(innerString); } - String start = '(' ; - String ending = ')' ; + String start = '('; + String ending = ')'; return start + String.join(innerStrings, ',') + ending; } else if (predicate instanceof String) { String input = (String) predicate;