class="ruby-identifier">changes_to_save</span>
  <span class="ruby-identifier">previous_values</span> = {}
  <span class="ruby-identifier">current_values</span> = {}

  <span class="ruby-identifier">changes</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">previous_values</span>[<span 