A little gotcha with custom setters for datetime attributes is, that when setting an attribute through ‘write_attribute’ it is not converted to UTC (or whatever else your default time zone is). This problem can easily be reproduced:
./script/generate model Thing a:datetime b:datetime
My model:
My tests:
The second assertion will fail. Is this intended or a bug? Quick fix: