Make it easy to record a diff in bulk
Make it easy to record a diff in bulk

After an `update_all` we may want to track the changes made for each of the affected records. To accomplish this I had to modify how we detect whether a record was created or updated. If we check what the id was before the last save, but no save was made, the value returned is `nil`, even if the record is persisted.

Instead, we now check if the record made any changes to the id in the last save, and if not, then we just return the current value of the id in order to determine whether the record is persisted. This allows us to use the `persist_tracked_changes` outside of an after save, which makes it possible to call it on a collection of records that were  just bulk updated without triggering callbacks.

culturecode/track_changes