code: func (s *configsService) Config(db *gorm.DB, app *App) (*Config, error) {
  	r, err := releasesFind(db, ReleasesQuery{App: app})
  	if err != nil {
  		if err == gorm.RecordNotFound {
  			// It's possible to have config without releases, this handles that.
  			c, err := configsFind(db, ConfigsQuery{App: app})
  			if err != nil {
  				if err == gorm.RecordNotFound {
  					// Return an empty config.
  					return &Config{
  						AppID: app.ID,
  						App:   app,
  						Vars:  make(Vars),
  					}, nil
  				}
  				return nil, err
  			}
  
  			return c, nil
  		}
  
  		return nil, err
  	}
  
  	return r.Config, nil
  }
docs: // Returns configs for latest release or the latest configs if there are no releases.