postgresql-orm 0.4.0 → 0.4.1
raw patch · 3 files changed
+9/−5 lines, 3 files
Files
- Database/PostgreSQL/ORM.hs +1/−1
- Database/PostgreSQL/ORM/Validations.hs +7/−3
- postgresql-orm.cabal +1/−1
Database/PostgreSQL/ORM.hs view
@@ -19,7 +19,7 @@ -- ** Chaining associations , nestAssoc, chainAssoc -- ** Validations- , ValidationError(..), validate, validateNotEmpty+ , ValidationError(..), validate, validateNotEmpty, validationError ) where import Database.PostgreSQL.ORM.Model
Database/PostgreSQL/ORM/Validations.hs view
@@ -28,14 +28,18 @@ type ValidationFunc a = a -> ValidationError +validationError :: T.Text -> T.Text -> ValidationError+validationError columnName description =+ ValidationError $ H.singleton columnName [description]+ validate :: (a -> Bool) -> T.Text -- ^ Column name -> T.Text -- ^ Error description -> ValidationFunc a validate validator columnName desc = \a ->- if validator a then- ValidationError H.empty- else ValidationError $ H.singleton columnName [desc]+ if validator a+ then mempty+ else validationError columnName desc validateNotEmpty :: (a -> T.Text) -> T.Text
postgresql-orm.cabal view
@@ -1,5 +1,5 @@ name: postgresql-orm-version: 0.4.0+version: 0.4.1 cabal-version: >= 1.14 build-type: Simple license: GPL