Adapt BatchCount for grouped records
If the relation is grouped, Rails returns Hash: { group-key => count } https://apidock.com/rails/ActiveRecord/Calculations/count Since batch_count expects Integer in order to sum the counts up, we receive an error. We can sum up the Hash's size in this case.
Showing
Please register or sign in to comment