Minor fix on model validation helper to avoid include the database as a
referrer of other objects.