lib/audited/auditor.rb in audited-5.4.3 vs lib/audited/auditor.rb in audited-5.5.0

- old
+ new

@@ -247,19 +247,20 @@ all_changes.slice(*self.class.audited_columns) else all_changes.except(*self.class.non_audited_columns) end + filtered_changes = normalize_enum_changes(filtered_changes) + if for_touch && (last_audit = audits.last&.audited_changes) filtered_changes.reject! do |k, v| last_audit[k].to_json == v.to_json || last_audit[k].to_json == v[1].to_json end end filtered_changes = redact_values(filtered_changes) filtered_changes = filter_encrypted_attrs(filtered_changes) - filtered_changes = normalize_enum_changes(filtered_changes) filtered_changes.to_hash end def normalize_enum_changes(changes) return changes if Audited.store_synthesized_enums