1602/jugglingdb — Issue #10: Dirty state overridden by validatesUniquenessOf
Author: juggy
Created: 2011-11-22 16:42:54+00:00
State: open

The dirty state of the object you are trying to save is overridden when using the validatesUniquenessOf validation. The code queries the DB but the implementation of a trivial identity map is overwriting the previous object data (which is pretty bad because you most likely validate when you are trying to save a dirty state).

From @1602 own comments in AbstractClass.all function:

// really questionable stuff
// goal is obvious: to not create different instances for the same object
// but the way it implemented...
// we can lost some dirty state of object, for example
// TODO: think about better implementation, test keeping dirty state

I think it might just be my error right now :P