concept47
concept47

Reputation: 31726

updated_at timestamp updating on save even when nothing has changed can I change that?

I'm mindlessly updating a database from another datasource every couple of minutes and some of the updates/saves are not really changes at all ... the same thing is just being written back over and over because, the datasource I'm pulling from says the object has changed, but the actual field that has changed is not one that I'm using.

I was hoping that since the object.changed? would be false that the updated_at timestamp would not update, but that is not the case, it changes on every update/save call.

Is there anyway to change this behavior to what I want (updated_at changes only when a field actually changes)?

Upvotes: 1

Views: 1213

Answers (1)

Danny
Danny

Reputation: 6025

This might be true in 2011 - but certainly no longer is the case now! (see Rails 4: .save does not update updated_at for existing records?)

Upvotes: 1

Related Questions