diff --git a/yesod-form/Yesod/Form/Fields.hs b/yesod-form/Yesod/Form/Fields.hs index e34e2e4e..d2aecf8a 100644 --- a/yesod-form/Yesod/Form/Fields.hs +++ b/yesod-form/Yesod/Form/Fields.hs @@ -516,6 +516,10 @@ optionsPersist filts ords toDisplay = fmap mkOptionList $ do , optionExternalValue = toPathPiece key }) pairs +-- | An alternative to 'optionsPersist' which returns just the @Key@ instead of +-- the entire @Entity@. +-- +-- Since 1.3.2 optionsPersistKey :: (YesodPersist site , PersistEntity a @@ -531,7 +535,7 @@ optionsPersistKey optionsPersistKey filts ords toDisplay = fmap mkOptionList $ do mr <- getMessageRender pairs <- runDB $ selectList filts ords - return $ Import.map (\(Entity key value) -> Option + return $ map (\(Entity key value) -> Option { optionDisplay = mr (toDisplay value) , optionInternalValue = key , optionExternalValue = toPathPiece key diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index a6c447f8..7767c390 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 1.3.1 +version: 1.3.2 license: MIT license-file: LICENSE author: Michael Snoyman