Rails Model Callbacks order
The callback order is as following:
before_validation
-
before_validation_on_create
/before_validation_on_update
after_validation
-
after_validation_on_create
/after_validation_on_update
before_save
before_create
DATABASE INSERT / DATABASE UPDATE
-
after_create
/after_update
after_save
-
after_commit
Written by David Paluy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#