diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index 40105b28..632c86e8 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -65,7 +65,7 @@ library , random >= 1.0.0.2 && < 1.1 , cereal >= 0.3 && < 0.4 , old-locale >= 1.0.0.2 && < 1.1 - , failure >= 0.1 && < 0.2 + , failure >= 0.2 && < 0.3 , containers >= 0.2 && < 0.5 , monad-control >= 0.3 && < 0.4 , transformers-base >= 0.4 diff --git a/yesod/scaffold/Application.hs.cg b/yesod/scaffold/Application.hs.cg index 896d12c8..e66ff96f 100644 --- a/yesod/scaffold/Application.hs.cg +++ b/yesod/scaffold/Application.hs.cg @@ -42,7 +42,7 @@ getApplication conf logger = do Database.Persist.Store.loadConfig >>= Database.Persist.Store.applyEnv p <- Database.Persist.Store.createPoolConfig (dbconf :: Settings.PersistConfig)~runMigration~ - let foundation = ~sitearg~ conf setLogger s p manager + let foundation = ~sitearg~ conf setLogger s p manager dbconf app <- toWaiAppPlain foundation return $ logWare app where diff --git a/yesod/scaffold/Foundation.hs.cg b/yesod/scaffold/Foundation.hs.cg index d0607bfd..dd3e7320 100644 --- a/yesod/scaffold/Foundation.hs.cg +++ b/yesod/scaffold/Foundation.hs.cg @@ -52,6 +52,7 @@ data ~sitearg~ = ~sitearg~ , getStatic :: Static -- ^ Settings for static file serving. , connPool :: Database.Persist.Store.PersistConfigPool Settings.PersistConfig -- ^ Database connection pool. , httpManager :: Manager + , persistConfig :: Settings.PersistConfig } -- Set up i18n messages. See the message folder. @@ -127,7 +128,12 @@ instance Yesod ~sitearg~ where -- How to run database actions. instance YesodPersist ~sitearg~ where type YesodPersistBackend ~sitearg~ = ~dbMonad~ - runDB f = fmap connPool getYesod >>= Database.Persist.Store.runPool (undefined :: Settings.PersistConfig) f + runDB f = do + master <- getYesod + Database.Persist.Store.runPool + (persistConfig master) + f + (connPool master) instance YesodAuth ~sitearg~ where type AuthId ~sitearg~ = UserId