Add scopes and relationships