Class: TrackChanges::Diff

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/track_changes/diff.rb

Instance Method Summary collapse

Instance Method Details

#changesObject

Returns a hash of changes where the key is the field name and the value is an array of the from value and the to value



12
13
14
15
16
# File 'app/models/track_changes/diff.rb', line 12

def changes
  Hash[(from.keys + to.keys).collect do |key|
    [key, [from[key], to[key]]]
  end]
end