PersistEntityGraph specifies type of single graph selector
This commit is contained in:
parent
effcfcca6b
commit
52f91cb98a
2 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,7 @@ import Prelude
|
|||
import Database.Persist
|
||||
|
||||
class (PersistEntity n, PersistEntity e) => PersistEntityGraph n e where
|
||||
type PersistEntityGraphSelector n e
|
||||
sourceParam :: e -> Key n
|
||||
sourceField :: EntityField e (Key n)
|
||||
destParam :: e -> Key n
|
||||
|
|
|
@ -56,6 +56,7 @@ instance Hashable ProjectRoleId where
|
|||
hash = hash . fromSqlKey
|
||||
|
||||
instance PersistEntityGraph Ticket TicketDependency where
|
||||
type PersistEntityGraphSelector Ticket TicketDependency = ProjectId
|
||||
sourceParam = ticketDependencyParent
|
||||
sourceField = TicketDependencyParent
|
||||
destParam = ticketDependencyChild
|
||||
|
|
Loading…
Reference in a new issue