fixes issue if grouped association ids are all NULL in calculation

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 :)