Updating embedded document with timestamp / MongoDate #357

Necsord opened this Issue Feb 26, 2012 · 2 comments

3 participants


Updating embedded document with timestamp / MongoDate

Pretty much 3 files controller and two models.

The paste should be self explanatory but basically I'm trying to empty embedded document in Users object and then reinsert the same data with different timestamp in one of the fields as Warnings model object.

Users model has three fields _id, login and warnings which is an array. Warnings model has three fields _id, user_id (MongoId) and created (MongoDate).

The problem is that although I'm doing the same exact things (Simple tteration over the process with changing time() as the only difference) sometimes ( seems like with certain timestamps ) timestamp isn't cast to MongoDate and when that happens user_id isn't cast to the MongoId as well.

I tried checking the query in \lithium\data\Model::save() but it seemed fine. _data and _original had timestamp while _updated had an MongoDate object. I could have missed something though.

I wanted to do a proper test case for this but seeing as I didn't do many things with mocks I decided to give up with that for now.

Union of RAD member

Hi @fitzagars, this issue seems to have already been solved in #471. Can you confirm ?

Union of RAD member

Closing as this seems to be solved.

@fitzagard and @Necsord, feel free to reopen if the issue persists. Thanks for reporting the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment