If you execute calculation grouped by association field and there are only NULL values, it throws ActiveRecord::RecordNotFound. It is diff just to show where the problem is better than in words, if anyone repairs it to other branch or in different style, please do that :)
fixes issue if grouped association ids are all NULL
you need to add a test-case to prevent regressions and illustrate the use-case.
Closing as stale. Thank you for the pull request.