This blog is part of our Rails 5.1 series.
Let’s say that we want to know all the deliveries in progress for an order.
The following code would do the job.
But usage of
should make more sense
However the changed code would return count for all the order deliveries, rather than returning only the ones in progress.
the block argument.
Rails 5.1 fixed this issue.
So now, we can
pass a block to