paper_trail 2.2.5 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/paper_trail/has_paper_trail.rb +4 -4
- data/lib/paper_trail/version_number.rb +1 -1
- data/test/unit/model_test.rb +6 -3
- metadata +4 -4
data/README.md
CHANGED
@@ -118,10 +118,10 @@ module PaperTrail
|
|
118
118
|
def record_destroy
|
119
119
|
if switched_on? and not new_record?
|
120
120
|
version_class.create merge_metadata(:item_id => self.id,
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
121
|
+
:item_type => self.class.base_class.name,
|
122
|
+
:event => 'destroy',
|
123
|
+
:object => object_to_string(item_before_change),
|
124
|
+
:whodunnit => PaperTrail.whodunnit)
|
125
125
|
end
|
126
126
|
versions.send :load_target
|
127
127
|
end
|
data/test/unit/model_test.rb
CHANGED
@@ -387,17 +387,20 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
|
387
387
|
end
|
388
388
|
|
389
389
|
should 'reify with the correct type' do
|
390
|
-
thing =
|
390
|
+
thing = Version.last.reify
|
391
391
|
assert_kind_of FooWidget, thing
|
392
|
+
assert_equal @foo.versions.first, Version.last.previous
|
393
|
+
assert_nil Version.last.next
|
392
394
|
end
|
393
395
|
|
394
|
-
|
395
396
|
context 'when destroyed' do
|
396
397
|
setup { @foo.destroy }
|
397
398
|
|
398
399
|
should 'reify with the correct type' do
|
399
|
-
thing =
|
400
|
+
thing = Version.last.reify
|
400
401
|
assert_kind_of FooWidget, thing
|
402
|
+
assert_equal @foo.versions[1], Version.last.previous
|
403
|
+
assert_nil Version.last.next
|
401
404
|
end
|
402
405
|
end
|
403
406
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paper_trail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 2.2.
|
9
|
+
- 6
|
10
|
+
version: 2.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Stewart
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-11 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|