journaled 2.0.0.rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3225d0de7f0075925f5d0298edfcb4e3a0028668
|
4
|
+
data.tar.gz: 2e81a750f88933b3e2d4aa9110663978aa45d852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b44a7510a9290074c794689c37d13cd07b04b6de5c677d2a4b6dc6710e1956c89e3c5f6ffc07a86c62d1cb732b9150f96828521709e1e91e5a76f32a90ffd0cd
|
7
|
+
data.tar.gz: 5afa77181bd2e1a5a95edcbfe08db8afd980cf0ec06024898000b0606e62e0ebeb98d14b4780b17d9863ba2dd59346556b3007f02e9a94b4f9a9e5dc2e24f0ed
|
@@ -33,7 +33,8 @@ module Journaled::Changes
|
|
33
33
|
raise(<<~ERROR)
|
34
34
|
#delete aborted by Journaled::Changes.
|
35
35
|
|
36
|
-
|
36
|
+
Call #destroy instead to ensure journaling or invoke #delete(force: true)
|
37
|
+
to override and skip journaling.
|
37
38
|
ERROR
|
38
39
|
end
|
39
40
|
end
|
@@ -46,7 +47,8 @@ module Journaled::Changes
|
|
46
47
|
|
47
48
|
#{conflicting_journaled_attribute_names.join(', ')}
|
48
49
|
|
49
|
-
|
50
|
+
Call #update instead to ensure journaling or invoke #update_columns
|
51
|
+
with additional arg `{ force: true }` to override and skip journaling.
|
50
52
|
ERROR
|
51
53
|
end
|
52
54
|
super(attributes)
|
@@ -69,9 +71,10 @@ module Journaled::Changes
|
|
69
71
|
where(primary_key => id_or_array).delete_all(force: true)
|
70
72
|
else
|
71
73
|
raise(<<~ERROR)
|
72
|
-
|
74
|
+
.delete aborted by Journaled::Changes.
|
73
75
|
|
74
|
-
|
76
|
+
Call .destroy(id_or_array) instead to ensure journaling or invoke
|
77
|
+
.delete(id_or_array, force: true) to override and skip journaling.
|
75
78
|
ERROR
|
76
79
|
end
|
77
80
|
end
|
@@ -3,11 +3,12 @@ module Journaled::RelationChangeProtection
|
|
3
3
|
unless force || !@klass.respond_to?(:journaled_attribute_names) || @klass.journaled_attribute_names.empty?
|
4
4
|
conflicting_journaled_attribute_names = @klass.journaled_attribute_names & updates.keys.map(&:to_sym)
|
5
5
|
raise(<<~ERROR) if conflicting_journaled_attribute_names.present?
|
6
|
-
|
6
|
+
.update_all aborted by Journaled::Changes due to journaled attributes:
|
7
7
|
|
8
8
|
#{conflicting_journaled_attribute_names.join(', ')}
|
9
9
|
|
10
|
-
|
10
|
+
Consider using .all(lock: true) or .find_each with #update to ensure journaling or invoke
|
11
|
+
.update_all with additional arg `{ force: true }` to override and skip journaling.
|
11
12
|
ERROR
|
12
13
|
end
|
13
14
|
super(updates)
|
@@ -20,7 +21,8 @@ module Journaled::RelationChangeProtection
|
|
20
21
|
raise(<<~ERROR)
|
21
22
|
#delete_all aborted by Journaled::Changes.
|
22
23
|
|
23
|
-
|
24
|
+
Call .destroy_all instead to ensure journaling or invoke .delete_all(force: true)
|
25
|
+
to override and skip journaling.
|
24
26
|
ERROR
|
25
27
|
end
|
26
28
|
end
|
data/lib/journaled/version.rb
CHANGED
@@ -56,7 +56,7 @@ RSpec.describe Journaled::Changes do
|
|
56
56
|
it "can be asserted on with our matcher" do
|
57
57
|
expect(klass).to journal_changes_to(:my_heart, as: :change_of_heart)
|
58
58
|
|
59
|
-
expect(klass).not_to journal_changes_to(:
|
59
|
+
expect(klass).not_to journal_changes_to(:foobaloo, as: :an_event_to_remember)
|
60
60
|
|
61
61
|
expect {
|
62
62
|
expect(klass).to journal_changes_to(:foobaloo, as: :an_event_to_remember)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journaled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Lipson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-02-
|
14
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: aws-sdk-resources
|
@@ -291,9 +291,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
291
291
|
version: '0'
|
292
292
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
293
293
|
requirements:
|
294
|
-
- - "
|
294
|
+
- - ">="
|
295
295
|
- !ruby/object:Gem::Version
|
296
|
-
version:
|
296
|
+
version: '0'
|
297
297
|
requirements: []
|
298
298
|
rubyforge_project:
|
299
299
|
rubygems_version: 2.5.1
|