Skip to content
This repository
Browse code

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...
commit b844bf6a65c4e8eb330f45ef7b8343bec657bab9 1 parent 0186c5d
Carlos Antonio da Silva authored
6  railties/guides/source/active_record_validations_callbacks.textile
Source Rendered
@@ -956,6 +956,7 @@ h4. Creating an Object
956 956
 * +before_validation+
957 957
 * +after_validation+
958 958
 * +before_save+
  959
+* +around_save+
959 960
 * +before_create+
960 961
 * +around_create+
961 962
 * +after_create+
@@ -966,6 +967,7 @@ h4. Updating an Object
966 967
 * +before_validation+
967 968
 * +after_validation+
968 969
 * +before_save+
  970
+* +around_save+
969 971
 * +before_update+
970 972
 * +around_update+
971 973
 * +after_update+
@@ -974,8 +976,8 @@ h4. Updating an Object
974 976
 h4. Destroying an Object
975 977
 
976 978
 * +before_destroy+
977  
-* +after_destroy+
978 979
 * +around_destroy+
  980
+* +after_destroy+
979 981
 
980 982
 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.
981 983
 
@@ -1020,7 +1022,7 @@ The following methods trigger callbacks:
1020 1022
 * +increment!+
1021 1023
 * +save+
1022 1024
 * +save!+
1023  
-* +save(false)+
  1025
+* +save(:validate => false)+
1024 1026
 * +toggle!+
1025 1027
 * +update+
1026 1028
 * +update_attribute+

0 notes on commit b844bf6

Please sign in to comment.
Something went wrong with that request. Please try again.