Changes between Initial Version and Version 1 of Ticket #12149
- Timestamp:
- Nov 4, 2009, 7:18:33 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12149
- Property Resolution → invalid
- Property Status new → closed
-
Ticket #12149 – Description
initial v1 22 22 In the above case, the flow goes like this 23 23 24 1. call overridden save method25 1. check the condition in save method (condition is false)26 1. call super27 1. call pre_save28 1. set name to "dont_save"29 1. object saved to database with name = "dont_save"24 1. call overridden save method 25 1. check the condition in save method (condition is false) 26 1. call super 27 1. call pre_save 28 1. set name to "dont_save" 29 1. object saved to database with name = "dont_save" 30 30 31 31 This is rather unintuitive that the pre_save gets called in the middle of the save method. Also, any processing done in the pre_save cannot be handled in the save method as the flow has gone to the super class by then. … … 33 33 The expected flow should be like this 34 34 35 1. call overridden save method36 1. call pre_save37 1. set name to "dont_save"38 1. execution enters save method39 1. check condition in overridden save method (condition is true)40 1. return without saving35 1. call overridden save method 36 1. call pre_save 37 1. set name to "dont_save" 38 1. execution enters save method 39 1. check condition in overridden save method (condition is true) 40 1. return without saving