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: 205035e968787393ef42062f36bdb6068e48a962
4
- data.tar.gz: bd6db1eec4f70ed2311e099d942014f9dd10c073
3
+ metadata.gz: 3225d0de7f0075925f5d0298edfcb4e3a0028668
4
+ data.tar.gz: 2e81a750f88933b3e2d4aa9110663978aa45d852
5
5
  SHA512:
6
- metadata.gz: 4f482a501e506d57a38345a985485846f842a714c16a0e4af90b1a130751af5ec482759ed1a72aada99db5435adf5fbea3f137caa3e7e341f245ebbd4a5bb0d3
7
- data.tar.gz: 46644b2d30fc64f0c52a810203940a8bffc6b8cd854635199582e356bbeb61c2749f87aa7046f8fa44d33011e384ec31983bd0be6537735d69d118777b84ec5f
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
- Invoke #delete(force: true) to override and skip journaling.
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
- Invoke #update_columns with additional arg `{ force: true }` to override and skip journaling.
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
- #delete aborted by Journaled::Changes.
74
+ .delete aborted by Journaled::Changes.
73
75
 
74
- Invoke #delete(id_or_array, force: true) to override and skip journaling.
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
- #update_all aborted by Journaled::Changes due to journaled attributes:
6
+ .update_all aborted by Journaled::Changes due to journaled attributes:
7
7
 
8
8
  #{conflicting_journaled_attribute_names.join(', ')}
9
9
 
10
- Invoke #update_all with additional arg `{ force: true }` to override and skip journaling.
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
- Invoke #delete_all(force: true) to override and skip journaling.
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
@@ -1,3 +1,3 @@
1
1
  module Journaled
2
- VERSION = "2.0.0.rc1".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
@@ -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(:your_heart, as: :something_else)
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.rc1
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-11 00:00:00.000000000 Z
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: 1.3.1
296
+ version: '0'
297
297
  requirements: []
298
298
  rubyforge_project:
299
299
  rubygems_version: 2.5.1