Method: Audited::Audit#old_attributes
- Defined in:
- lib/audited/audit.rb
#old_attributes ⇒ Object
Returns a hash of the changed attributes with the old values
90 91 92 93 94 |
# File 'lib/audited/audit.rb', line 90 def old_attributes (audited_changes || {}).each_with_object({}.with_indifferent_access) do |(attr, values), attrs| attrs[attr] = (action == "update") ? values.first : values end end |