0
votes

I update a particular field of a record in my observer with a callback before_create . Does this update, also trigger the callback after_update. ? As in my case. This seems to be happening. I confirmed by placing debuggers in my code. Why does this happen ?

1
No, this shouldn't happen. before_create Is called before Base.save on new objects that haven‘t been saved yet (no record exists). Please provide some model code so that one able to answer.Salil

1 Answers

1
votes

Rails ActiveRecord callback hierarchy

(-) save
(-) valid
(1) before_validation
(2) before_validation_on_create
(-) validate
(-) validate_on_create
(3) after_validation
(4) after_validation_on_create
(5) before_save
(6) before_create
(-) create
(7) after_create
(8) after_save