bjartek / computer-database-mongo

Computer-database example from play 2.0 distribution with mongo as persistence using salat
33 stars 8 forks source link

You can only add exactly one new computer #2

Closed ghost closed 12 years ago

ghost commented 12 years ago

After the first start, we can only add one new computer.

When adding a second computer, there no error message, but the new computer is never saved in mongodb.

After restart of play you can add again exactly one more computer.

Modifications work fine.

ghost commented 12 years ago

Solution:

In Application.scala, line 100

replace ComputerDAO.insert(computer) by ComputerDAO.insert(computer.copy(id = new ObjectId()))

bjartek commented 12 years ago

Thanks for the solution! Want to give at stab at sending a pull request or should I just fix it myself?

Not sure why this happends though. And I think perhaps that this should be moved to the fromForm method in the Computer object. Will give a stab at it later today after i finish #1 and clear up some time.