code: func (j TableJoin) Validate(db *gorm.DB) error {
  	dialect := db.Dialect()
  	dialect.SetDB(db.CommonDB())
  	if j.Active {
  		for _, f := range j.HandledFields {
  			var allowed bool
  			for _, allowedColumn := range j.AllowedColumns {
  				if allowedColumn == f {
  					allowed = true
  				}
  			}
  			if !allowed {
  				if !dialect.HasColumn(j.TableName, f) {
  					return errs.Errorf(`table "%s" has no column "%s"`, j.TableName, f)
  				}
  			}
  		}
  	}
  	return nil
  }
docs: // Validate returns nil if the join is active and all the fields handled by this
  // join do exist in the joined table; otherwise an error is returned.