Skip to content

Commit

Permalink
bump bson for toSinglepiece fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gregwebs committed Sep 14, 2011
1 parent 95247f6 commit 07142de
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion persistent-mongoDB/Database/Persist/MongoDB.hs
Expand Up @@ -57,7 +57,7 @@ type ConnectionPool = (Pool.Pool IOError DB.Pipe, Database)

instance SinglePiece (Key DB.Action entity) where
toSinglePiece (Key pOid@(PersistObjectId _)) = -- T.pack $ show $ Serialize.encode bsonId
let oid@(DB.Oid _ _) = persistObjectIdToDbOid pOid
let oid = persistObjectIdToDbOid pOid
in T.pack $ show oid
toSinglePiece k = throw $ PersistInvalidField $ "Invalid Key (expected PersistObjectId): " ++ show k

Expand Down
4 changes: 2 additions & 2 deletions persistent-mongoDB/persistent-mongoDB.cabal
@@ -1,5 +1,5 @@
name: persistent-mongoDB
version: 0.6.1
version: 0.6.2
license: BSD3
license-file: LICENSE
author: Greg Weber <greg@gregweber.info>
Expand All @@ -22,7 +22,7 @@ library
, bytestring >= 0.9 && < 0.10
, enumerator >= 0.4 && < 0.5
, mongoDB >= 1.1 && < 1.2
, bson >= 0.1.5
, bson >= 0.1.6
, network >= 2.2.1.7
, compact-string-fix >= 0.3.1 && < 0.4
, cereal >= 0.3.0.0
Expand Down
4 changes: 2 additions & 2 deletions persistent/persistent.cabal
Expand Up @@ -43,15 +43,15 @@ test-suite test
hs-source-dirs: test, persistent-template, persistent-sqlite, persistent-postgresql, persistent-mongoDB

build-depends: HUnit
, hspec >= 0.6.1 && < 0.7
, hspec >= 0.8 && < 0.9
, file-location >= 0.4 && < 0.5
, base >= 4 && < 5
, template-haskell >= 2.4 && < 2.7
, HDBC-postgresql
, HDBC
-- mongoDB dependencies
, mongoDB == 1.1.*
, bson >= 0.1.5
, bson >= 0.1.6
, cereal
, network
, compact-string-fix
Expand Down
3 changes: 1 addition & 2 deletions persistent/test/main.hs
Expand Up @@ -24,7 +24,6 @@ import Database.Persist.Base (DeleteCascade (..), PersistValue(..))

import Database.Persist.Join (selectOneMany, SelectOneMany(..))
import qualified Database.Persist.Join
import FileLocation (debug)

#if WITH_MONGODB
import qualified Database.MongoDB as MongoDB
Expand Down Expand Up @@ -462,7 +461,7 @@ specs = describe "persistent" $ do
prop "toSinglePiece - fromSinglePiece" $ \piece ->
let key1 = Key piece :: (Key BackendMonad Person)
key2 = fromJust $ fromSinglePiece $ toSinglePiece key1 :: (Key BackendMonad Person)
in (debug $ toSinglePiece key1) == (debug $ toSinglePiece key2)
in toSinglePiece key1 == toSinglePiece key2

it "replace" $ db $ do
key2 <- insert $ Person "Michael2" 27 Nothing
Expand Down

0 comments on commit 07142de

Please sign in to comment.