Get rid of an undefined in scaffolding

This commit is contained in:
Michael Snoyman 2012-01-19 19:18:46 +02:00
parent c1af428036
commit 88882861cf
3 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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