Fix detection of relation name when user extends other class which overrides relation method