AfterSave callback but only when the record is new

I want to trigger a callback after the creation of an object. With a
after_create I have the problem that if the record crash for any
reason when save, then I have some corrupt data. So I need a callback
after_save but only when the record is new.

On 7 February 2011 21:35, Matias F. [email protected] wrote:

I want to trigger a callback after the creation of an object. With a
after_create I have the problem that if the record crash for any
reason when save, then I have some corrupt data. So I need a callback
after_save but only when the record is new.

As far as I know after_create is after_save but only when the record
is new. What is the problem that you have using after_create?

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs