This project is archived and is in readonly mode.

#625 ✓resolved
Stefan Kaes

observers should not add an after_find method to the observed class

Reported by Stefan Kaes | July 15th, 2008 @ 07:16 PM | in 2.1.1

Observers should not modify observed classes by defining an empty after_find method on the observed class.

First, it's evil to silently add a method.

Second, it slows down instantiating objects of the observed class, because executing the callback chain is expensive. I measure 10-20% difference for my application.

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