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
First problem is we run find on an array of ids, which returns an array and not a relation. Mainly because we wanted it to raise an error if the id didn't exist. We could probably replace that with a where instead.
Basically we run each record through the authorization policy, if authorization is enabled.
The code above filters out those records you are not permitted to batch action. We could replace this with a new query. So we'd have an additional query prior to the batch action executing, but a lot less for the actual batch action.
In order to be consistent with the filter API, more flexible, and allow more performance, I think this should be considered.
Right now the following code generates 30 queries (for 30 ids selected)
Whereas this one would generate just one
What do you think? With a relation object, one could still loop over the collection, if that's required.
The text was updated successfully, but these errors were encountered: