class ActiveModel::AttributeMutationTracker

def changes

def changes
  attr_names.each_with_object(ActiveSupport::HashWithIndifferentAccess.new) do |attr_name, result|
    if change = change_to_attribute(attr_name)
      result.store(attr_name, change, convert_value: false)
    end
  end
end