Some fixes for persistent2

This commit is contained in:
Michael Snoyman 2014-08-27 10:53:17 +03:00
parent 6eb1447dd9
commit 30352f56ec
2 changed files with 5 additions and 0 deletions

View File

@ -477,6 +477,10 @@ type YesodAuthPersist master =
--
-- Since 1.2.0
type AuthEntity master = KeyEntity (AuthId master)
#if MIN_VERSION_persistent(2, 0, 0)
type family KeyEntity key
type instance KeyEntity (Key x) = x
#endif
-- | Similar to 'maybeAuthId', but redirects to a login page if user is not
-- authenticated or responds with error 401 if this is an API client (expecting JSON).

View File

@ -1,5 +1,6 @@
{-# LANGUAGE OverloadedStrings, TemplateHaskell, QuasiQuotes, TypeFamilies #-}
{-# LANGUAGE EmptyDataDecls, FlexibleContexts, GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Yesod.PersistSpec where
import Test.Hspec