Dirty objects

Bill McG wrote: [...]

I want to send an email when someone changes a field in the record. I would think I could do this with the 'update' method in the controller:


Doing something like @log.changes doesn't work as @log was just retrieved from the database and has no changes.

So don't do it in the controller. Use a before_update callback instead. That should give you access to the model object without having to retrieve it from the DB again.