How Many Types Of Call...
How Many Types Of Call...
There are four main types of callbacks available in Ruby on Rails:
before_validation: Runs before validation so you can make sure your data is in good shape[1].
before_save: This happens just before the record is saved, making it great for final adjustments[1].
after_save: This runs right after the record is saved for things like sending notifications[1].
after_commit: This occurs after the transaction is committed, ensuring data integrity[1].
Rails provides a total of nineteen callbacks in total, which give a lot of control over how to react and prepare for each state in the Active Record life cycle[3]. Some other callback types include:
senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào