Ruby on Rails Callback, what is difference between :before_save and :before_create?
问题 Could you explain in detail what the :before_save and :before_create Ruby on Rails callbacks are, and what they have to do with Rails validations? Does validation occur after :before_save or :before_create ? 回答1: In a create operation under Rails, there are six callbacks before the database operation, and two after. In order, these are: before_validation before_validation_on_create after_validation after_validation_on_create before_save before_create DATABASE INSERT after_create after_save