At the opening of the dirty data (dirty objects), the writer sometimes does not pass a number of changes to the database are not kept inside.
Such as the following code:
self.org_common_flag[COMMON_FLAGS[:agent_flag]]= self.agent_flag ? "0" : "1"
In fact it has already amended the string of a character, but through the writer because they do not call, dirty mark or not changed. Show:
Plus a mandatory must want will_change!, Would have modified signs.
self.org_common_flag_will_change! self.org_common_flag[COMMON_FLAGS[:agent_flag]]= self.agent_flag ? "0" : "1"
Dirty data to reduce a large number of unrelated data update, it also brings some inconvenience, which requires a better test coverage.
Note the use of debugging time _changed?, _change Way to check whether the trigger dirty data. And observe the log in the sql output and check the database content.