1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-29 00:44:52 +09:00

PersistEntityGraph specifies type of single graph selector

This commit is contained in:
fr33domlover 2016-08-02 15:44:45 +00:00
parent effcfcca6b
commit 52f91cb98a
2 changed files with 2 additions and 0 deletions

View file

@ -23,6 +23,7 @@ import Prelude
import Database.Persist import Database.Persist
class (PersistEntity n, PersistEntity e) => PersistEntityGraph n e where class (PersistEntity n, PersistEntity e) => PersistEntityGraph n e where
type PersistEntityGraphSelector n e
sourceParam :: e -> Key n sourceParam :: e -> Key n
sourceField :: EntityField e (Key n) sourceField :: EntityField e (Key n)
destParam :: e -> Key n destParam :: e -> Key n

View file

@ -56,6 +56,7 @@ instance Hashable ProjectRoleId where
hash = hash . fromSqlKey hash = hash . fromSqlKey
instance PersistEntityGraph Ticket TicketDependency where instance PersistEntityGraph Ticket TicketDependency where
type PersistEntityGraphSelector Ticket TicketDependency = ProjectId
sourceParam = ticketDependencyParent sourceParam = ticketDependencyParent
sourceField = TicketDependencyParent sourceField = TicketDependencyParent
destParam = ticketDependencyChild destParam = ticketDependencyChild