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:

http://apidock.com/rails/activerecord/callbacks/after_save


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -