After_save deletes is an exception is raised?

Does after_save in a model delete if an exception is raised in there?

I simply did

def after_save
raise ‘hmmm’
end

and it raised the exception but there was nothing in the database. I
removed that entire method and its in the database. Is this correct?

Thank You,
Ben J.
E: [email protected]

On Jul 17, 2006, at 3:04 PM, Ben J. wrote:

Does after_save in a model delete if an exception is raised in there?

Look for BEGIN … ROLLBACK in your logs. That’s the save transaction
rolling back due to the exception in after_save. It’s as if your
record was never created.

jeremy

So it the row locked or something until after_save is completed?
Because I am calling methods in after_save that do things with that
new row addition. These other methods are saying that it doesn’t
exist, because the other methods are doing Model.find the_id.

Thanks for your help.

Thank You,
Ben J.
E: [email protected]

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