modify behavior of updated_at magic field

is it possible to modify magic field updated_at so it will update only
when ceratin columns are changed?

if not, I guess I have to do it on my own. In that case, how do I
tell if a field has changed in the, say, before_save callback?

I guess I can do something like this

def foo=(val)
      self.foo_changed = true

will that do?

Off the top of my head could you do something like this? Give it try.

def updated_at if attributes_changed?


def attributes_changed?
stale_record = self.reload !=

Although that does force a read from the database.


There are a couple of plugins that provide that:

(I haven't used any.)

-- fxn

You can turn automatic timestamps off this way:

    MyModel.record_timestamps = false

So in a callback you could check whether the columns have been changed with this plugin:

and set the flag accordingly.

-- fxn