code: func (q ReleasesQuery) scope(db *gorm.DB) *gorm.DB {
  	var scope composedScope
  
  	if app := q.App; app != nil {
  		scope = append(scope, fieldEquals("app_id", app.ID))
  	}
  
  	if version := q.Version; version != nil {
  		scope = append(scope, fieldEquals("version", *version))
  	}
  
  	scope = append(scope, inRange(q.Range.WithDefaults(q.DefaultRange())))
  
  	return scope.scope(db)
  }
docs: // scope implements the scope interface.