culturecode-track_changes 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/track_changes/model.rb +1 -1
- data/lib/track_changes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6e3ca848bdacd4592637bd51cce7aee4e5a574e
|
4
|
+
data.tar.gz: c9f521645c6476d4c530e38a82e2efcf3d16feda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3260b8b1cded3f032c565f2a6962e9a3707148e58424c74d773941b75c9b412f3a58a148609fab65e3f2cfcb7a8ded36b69db986b5e72c5714c5748681b1c13e
|
7
|
+
data.tar.gz: 6c31e97c86d94df0d956eeec6aa34bb976cf3bb03617d42b468791e7d15c160ccbb7a02b807ccd8e191c93cce8a028b75a7eeca6d06f24a29426d34f6e6cc86d
|
data/lib/track_changes/model.rb
CHANGED
@@ -12,7 +12,7 @@ module TrackChanges
|
|
12
12
|
attr_writer :track_changes_by # Faux attribute to store who made the changes so we can save it in the diff
|
13
13
|
|
14
14
|
has_one :snapshot, :as => :record, :class_name => 'TrackChanges::Snapshot' # A representation of this record as it was last saved
|
15
|
-
has_many :diffs, :as => :record, :class_name => 'TrackChanges::Diff' # A representation of changes made between saves through this record's lifetime
|
15
|
+
has_many :diffs, lambda { reorder('id DESC') }, :as => :record, :class_name => 'TrackChanges::Diff' # A representation of changes made between saves through this record's lifetime
|
16
16
|
|
17
17
|
after_save :persist_tracked_changes
|
18
18
|
end
|