You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The collection operators used on relationships within NSPredicate are not currently working. I am trying to use a sum operation but am getting an error. This works in my existing Magical Record / Core Data application, but fails when I switch to EncryptedStore.
I'll describe my problem in terms of the FailedBankCD data model. Perform the following changes:
Add a new FailedBankCustomer entity with a 'balance' Integer 32
Create a to-many relationship on FailedBankInfo: 'customers' to FailedBankCustomer
// Find only the failed banks where the total balance across all customers > 100NSPredicate *totalBalancePredicate = [NSPredicatepredicateWithFormat:@"customers.@sum.balance > 100"];
[FailedBankInfo MR_fetchAllSortedBy:@"name"ascending:YESwithPredicate:totalBalancePredicate groupBy:nildelegate:self];
The follow is the error I'm running into:
+[MagicalRecord(ErrorHandling) defaultErrorHandler:](0x2ec308) Error: no such column: customers.@sum.balance
The following is the generated query that triggers the above error:
SELECTFailedBankInfo.IDFROM FailedBankInfo JOIN FailedBankCustomer AS [customers] ONFailedBankInfo.customers_id= [customers].ID WHERE ([customers.@sum].balance > ?) ORDER BYFailedBankInfo.nameASC;
The text was updated successfully, but these errors were encountered:
This should be fixed now by commit 4ee23af, at least for the simpler comparison cases (i.e. foo.@sum.bar > faz and @sum.bar > faz). Closing this issue, but let me know if you encounter any more cases where the sum predicate is broken. Thanks again for finding this issue.
The collection operators used on relationships within NSPredicate are not currently working. I am trying to use a sum operation but am getting an error. This works in my existing Magical Record / Core Data application, but fails when I switch to EncryptedStore.
I'll describe my problem in terms of the FailedBankCD data model. Perform the following changes:
The follow is the error I'm running into:
The following is the generated query that triggers the above error:
The text was updated successfully, but these errors were encountered: