add test for 'add_related_count' issue #284.