Adding has() functionality for hasMany and hasOne relations