richmarr/resourceful — pull request #2 by richmarr (2011-12-15 08:54:27+00:00)
Title: Set Resource.isNewRecord to false when pulled from cache or DB

I noticed that when using `Resource.timestamp()` the created and modified dates created were always the same, (i.e. `obj.ctime === obj.mtime`) even for records that had been saved, retrieved, modified then updated.

It seems like the isNewRecord property is always assumed to be true, which causes `Resource.save()` to overwrite the existing `ctime` value.

A change that worked for me is to set that value to false when the Resource instance is instantiated from an existing database or cache object, see attached change.