Skip to content

Instantly share code, notes, and snippets.

@milieu
Created March 26, 2014 00:03
Show Gist options
  • Save milieu/9774177 to your computer and use it in GitHub Desktop.
Save milieu/9774177 to your computer and use it in GitHub Desktop.
Temp trait question
// The snippet in question
def auditTypesQuery: List[DetailTable] = {
for {
detail <- detailsComponent.DetailTables
} yield detail
}.list
// Simplified trait I'm making:
trait CSVImporter { self =>
def detailsComponent: models.DetailTablesComponent
def auditTypesQuery = // ... same as above, gives this error:
// value map is not a member of object models.DetailTablesComponent#DetailTables
}
// Class that uses auditTypesQuery
@Singleton
class HierarchyCSVImporter @Inject() (dc: DatabaseComponent) extends CSVImporter with Results with Formats {
import database.Driver.simple._
import database.Driver.simple.Database.threadLocalSession
val database = dc
def db = Database.forDataSource(DB.getDataSource())
def detailsComponent: models.DetailTablesComponent =
new DetailTablesComponent(database)
def auditTypesQuery = // ... same as above, no errors
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment