Why callbacks for the after_find and after_initialize events is to define them as methods?

Posted by piemesons on Stack Overflow See other posts from Stack Overflow or by piemesons
Published on 2010-05-11T06:31:22Z Indexed on 2010/05/11 6:34 UTC
Read the original article Hit count: 141

Filed under:
|

The only way to define callbacks for the after_find and after_initialize events is to define them as methods. If you try declaring them as handlers using the second technique, they’ll be silently ignored.

Can anybody explain why is it so?

Why specifically for these two callbacks?

© Stack Overflow or respective owner

Related posts about callback

Related posts about ruby-on-rails