// AddComments adds related model Comments and matches to given Post.
AddComments adds related model Comments and matches to given Post.
// AddComments adds related model Comments and matches to given Post .
func (p *postsQueryBuilder) AddComments(_comments ...*Comment) error {
	if p.err != nil {
		return p.err
	}
	relation, err := NRN_Posts.Model.RelationByIndex(6)
	if err != nil {
		return errors.Wrapf(mapping.ErrInternal, "getting 'Comments' relation by index for model 'Post' failed: %v", err)
	}
	models := make([]mapping.Model, len(_comments))
	for i := range _comments {
		models[i] = _comments[i]
	}
	return p.builder.AddRelations(relation, models...)
}
func ( p * postsQueryBuilder ) AddComments ( _comments ... * Comment ) error { if p . err != nil { return p . err } relation , err := NRN_Posts . Model . RelationByIndex ( 6 ) if err != nil { return errors . Wrapf ( mapping . ErrInternal , " " , err ) } models := make ( [ ] mapping . Model , len ( _comments ) ) for i := range _comments { models [ i ] = _comments [ i ] } return p . builder . AddRelations ( relation , models ... ) }
AddComments adds related model Comments and matches to given Post.
AddComments adds related model Comments and matches to given Post .