This project is archived and is in readonly mode.

#676 ✓resolved
George Ogata

Let observers create after_find if they need it

Reported by George Ogata | July 22nd, 2008 @ 10:19 PM | in 2.x

Ticket #625 removed the line that caused observers to define an after_find method in the model if it didn't exist yet. This caused a speed-up (defining after_find can slow things down), but for cases where after_find is observed and not defined in the model, it means that an empty after_find must be explicitly defined in the model. It can be tricky to work out why an observer is failing due to this.

This patch restores the previous behavior, but only if the observer actually has an after_find defined. Hopefully, this offers the best of both worlds.

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages