4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/track_changes/model.rb', line 4
def tracks_changes(options = {})
extend ClassMethods
include InstanceMethods
class_attribute :track_changes_options
self.track_changes_options = options
attr_accessor :track_changes attr_writer :track_changes_by
has_one :snapshot, :as => :record, :class_name => 'TrackChanges::Snapshot' has_many :diffs, lambda { reorder('id DESC') }, :as => :record, :class_name => 'TrackChanges::Diff'
after_save :persist_tracked_changes
end
|