Return empty result if query doesn't have any data

Current request 'relate' will return a array with related key but
nothing else, if called to match value with no data. This will result
in error to models extending base model.

This fix skip the 'belong_to' and 'has_many' call if no data was found.