Last Updated: February 25, 2016
·
1.528K
· dpaluy

Rails Model Callbacks order

The callback order is as following:

  1. before_validation
  2. before_validation_on_create / before_validation_on_update
  3. after_validation
  4. after_validation_on_create / after_validation_on_update
  5. before_save
  6. before_create

DATABASE INSERT / DATABASE UPDATE

  1. after_create / after_update
  2. after_save
  3. after_commit