Only call Rails Active Record callback on successful model create -
i want add after_create :my_function 1 of models. how can make sure method called on successful creates or updates?
you'd want use after_save. callback called on both create , updates (or, call save method) long callback chain isn't broken before save completes (validation errors, etc). can see examples in docs:
Comments
Post a Comment