yesod-persistent 1.2.1 → 1.2.2
raw patch · 2 files changed
+10/−3 lines, 2 files
Files
- Yesod/Persist/Core.hs +9/−2
- yesod-persistent.cabal +1/−1
Yesod/Persist/Core.hs view
@@ -28,6 +28,8 @@ import Data.IORef.Lifted import Data.Conduit.Pool import Control.Monad.Trans.Resource+import Control.Exception (throwIO)+import Yesod.Core.Types (HandlerContents (HCError)) import qualified Database.Persist.Sql as SQL type YesodDB site = YesodPersistBackend site (HandlerT site IO)@@ -132,7 +134,7 @@ get404 key = do mres <- get key case mres of- Nothing -> lift notFound+ Nothing -> notFound' Just res -> return res -- | Get the given entity by unique key, or return a 404 not found if it doesn't@@ -148,8 +150,13 @@ getBy404 key = do mres <- getBy key case mres of- Nothing -> lift notFound+ Nothing -> notFound' Just res -> return res++-- | Should be equivalent to @lift . notFound@, but there's an apparent bug in+-- GHC 7.4.2 that leads to segfaults. This is a workaround.+notFound' :: MonadIO m => m a+notFound' = liftIO $ throwIO $ HCError NotFound instance MonadHandler m => MonadHandler (SqlPersistT m) where type HandlerSite (SqlPersistT m) = HandlerSite m
yesod-persistent.cabal view
@@ -1,5 +1,5 @@ name: yesod-persistent-version: 1.2.1+version: 1.2.2 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>