#24 new
hkstar

make created_at and updated_at override-able

Reported by hkstar | November 22nd, 2008 @ 03:30 AM

Currently CouchRest::Model writes created_at and updated_at into objects it saves regardless of whether the fields are pre-existing.

I propose allowing created_at to be overridden if it's already present, as that obviously means it's been manually set.

Allowing override of updated_at is more complex, as it is presumed to preexist when an existing record is re-saved, and there's no way for CR to know if the updated_at field has been manually changed since it was loaded from DB or not. It's probably too annoying/complex to implement some kind of flag/which fields are dirty system so maybe ignore this for now unless dev has different ambitions. Obviously, however, if it's a new record it should also respect the override on created_at if present.

What do you think?

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

"CouchDB, close to the metal." <a href="http://github.com/jchris/couchrest/tree/master">CouchRest</a> is a RESTful layer for accessing CouchDB, based off CouchDB's included Javascript reference client. CouchRest also includes helpers for running large queries etc. There is also a base class for ActiveRecord / Datamapper style ORM, called CouchRest::Model.

People watching this ticket

Pages