Skip to content

Commit

Permalink
Fix callbacks order for destroying an object in validations guide
Browse files Browse the repository at this point in the history
Also add around save to creating/updating callbacks order, and fix save
example with no validation
  • Loading branch information
carlosantoniodasilva committed Jan 25, 2012
1 parent 0186c5d commit b844bf6
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -956,6 +956,7 @@ h4. Creating an Object
* +before_validation+
* +after_validation+
* +before_save+
* +around_save+
* +before_create+
* +around_create+
* +after_create+
Expand All @@ -966,6 +967,7 @@ h4. Updating an Object
* +before_validation+
* +after_validation+
* +before_save+
* +around_save+
* +before_update+
* +around_update+
* +after_update+
Expand All @@ -974,8 +976,8 @@ h4. Updating an Object
h4. Destroying an Object

* +before_destroy+
* +after_destroy+
* +around_destroy+
* +after_destroy+

WARNING. +after_save+ runs both on create and update, but always _after_ the more specific callbacks +after_create+ and +after_update+, no matter the order in which the macro calls were executed.

Expand Down Expand Up @@ -1020,7 +1022,7 @@ The following methods trigger callbacks:
* +increment!+
* +save+
* +save!+
* +save(false)+
* +save(:validate => false)+
* +toggle!+
* +update+
* +update_attribute+
Expand Down

0 comments on commit b844bf6

Please sign in to comment.