Rails callback for the equivalent of "after_new"

Posted by Joe Cairns on Stack Overflow See other posts from Stack Overflow or by Joe Cairns
Published on 2010-05-14T17:26:30Z Indexed on 2010/05/15 1:34 UTC
Read the original article Hit count: 239

Filed under:
|

Right now I cant find a way to generate a callback between lines 1 and 2 here:

f = Foo.new
f.some_call
f.save!

Is there any way to simulate what would be effectively an after_new callback? Right now I'm using after_initialize but there are potential performance problems with using that since it fires for a lot of different events.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about callback