Skip to content

Commit

Permalink
Fixes failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamessimone committed Oct 29, 2024
1 parent 552c91c commit d8eedc5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions force-app/repository/Query.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d8eedc5

Please sign in to comment.