This project is archived and is in readonly mode.

#5000 ✓wontfix
Fabien Jakimowicz

before and after write callbacks

Reported by Fabien Jakimowicz | June 29th, 2010 @ 03:02 AM | in 3.0.2

I sometimes need to call the same callback after creating, saving and destroying a model.

Since it is easy to add a complete set of callbacks (before/around/after), I've added the before callback too.

This patch for ActiveRecord adds 2 callbacks : before_write and after_write.

For Rails 3.0, the after_write is called within the database transaction and have a chance to perform database modifications before the final commit, like after_save.

Both patches comes with documentation and unit tests.

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>