Permalink
Browse files

Fix callbacks order for destroying an object in validations guide

Also add around save to creating/updating callbacks order, and fix save
example with no validation
  • Loading branch information...
1 parent 0186c5d commit b844bf6a65c4e8eb330f45ef7b8343bec657bab9 @carlosantoniodasilva carlosantoniodasilva committed Jan 25, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 railties/guides/source/active_record_validations_callbacks.textile
@@ -956,6 +956,7 @@ h4. Creating an Object
* +before_validation+
* +after_validation+
* +before_save+
+* +around_save+
* +before_create+
* +around_create+
* +after_create+
@@ -966,6 +967,7 @@ h4. Updating an Object
* +before_validation+
* +after_validation+
* +before_save+
+* +around_save+
* +before_update+
* +around_update+
* +after_update+
@@ -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.
@@ -1020,7 +1022,7 @@ The following methods trigger callbacks:
* +increment!+
* +save+
* +save!+
-* +save(false)+
+* +save(:validate => false)+
* +toggle!+
* +update+
* +update_attribute+

0 comments on commit b844bf6

Please sign in to comment.