deferring 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 483b0386e63cef046ab56e350801326a13fefdbc61b3437d7773a594bdc7d3cb
4
- data.tar.gz: 300a1af607012499adc4e0e77a9c9f517a5fc41ec9590619da4c32e122d9017e
3
+ metadata.gz: 81e75a7942010a6fe9e3e7696801b286d919877a1b9b9fe2e60dd988b9a1a57e
4
+ data.tar.gz: 0c312c277072b7831e94933bb5e496f89acbc8abad032537eb871ac52be1d2fd
5
5
  SHA512:
6
- metadata.gz: c57a7ca6222a03482432a740df27ab33980f07645f6365163348d7a105956c3d04173a6d3f710e8b5beff415ac34a81b28e15f4a0dae85b988495de92d1384c1
7
- data.tar.gz: 0e449f9d3f137f8e21cbbde3073eba4533a66b983ce1d8784e0dc35d82b0964bc1569fb10734cb16474ae56ece5b346bde2bbb12a2a0bb7dd47afa9b17e135ce
6
+ metadata.gz: 730d5fa707a75a44c6eb6477a918beb0d83333899ed977f274f4ed8c745bb5d8b0fed7193b4086c3f68e0c596e976d2744c6fa5ba7f5d9aedc1646f1d92da196
7
+ data.tar.gz: 509f827d37021a1bda15cdb9bdd1fc363a5261351ef6af1a1ba1644063df5266aec620fe874187cc9e826a048702d04750ab0366ea9049cb499f4d3e31ab2467
data/Appraisals CHANGED
@@ -22,3 +22,8 @@ appraise 'rails-61' do
22
22
  gem 'activerecord', '6.1.7.1'
23
23
  gem 'sqlite3'
24
24
  end
25
+
26
+ appraise 'rails-70' do
27
+ gem 'activerecord', '7.0.8'
28
+ gem 'sqlite3'
29
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deferring (0.8.1)
4
+ deferring (0.8.2)
5
5
  activerecord (>= 4.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deferring (0.8.1)
4
+ deferring (0.8.2)
5
5
  activerecord (>= 4.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deferring (0.8.1)
4
+ deferring (0.8.2)
5
5
  activerecord (>= 4.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deferring (0.8.1)
4
+ deferring (0.8.2)
5
5
  activerecord (>= 4.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- deferring (0.8.1)
4
+ deferring (0.8.2)
5
5
  activerecord (>= 4.2)
6
6
 
7
7
  GEM
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "7.0.8"
6
+ gem "sqlite3"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,63 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ deferring (0.8.2)
5
+ activerecord (>= 4.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.0.8)
11
+ activesupport (= 7.0.8)
12
+ activerecord (7.0.8)
13
+ activemodel (= 7.0.8)
14
+ activesupport (= 7.0.8)
15
+ activesupport (7.0.8)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ appraisal (2.5.0)
21
+ bundler
22
+ rake
23
+ thor (>= 0.14.0)
24
+ concurrent-ruby (1.2.3)
25
+ diff-lcs (1.5.1)
26
+ i18n (1.14.1)
27
+ concurrent-ruby (~> 1.0)
28
+ mini_portile2 (2.8.5)
29
+ minitest (5.22.2)
30
+ rake (13.1.0)
31
+ rspec (3.13.0)
32
+ rspec-core (~> 3.13.0)
33
+ rspec-expectations (~> 3.13.0)
34
+ rspec-mocks (~> 3.13.0)
35
+ rspec-core (3.13.0)
36
+ rspec-support (~> 3.13.0)
37
+ rspec-expectations (3.13.0)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.13.0)
40
+ rspec-mocks (3.13.0)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.13.0)
43
+ rspec-support (3.13.0)
44
+ sqlite3 (1.7.2)
45
+ mini_portile2 (~> 2.8.0)
46
+ thor (1.3.0)
47
+ tzinfo (2.0.6)
48
+ concurrent-ruby (~> 1.0)
49
+
50
+ PLATFORMS
51
+ x86_64-linux
52
+
53
+ DEPENDENCIES
54
+ activerecord (= 7.0.8)
55
+ appraisal
56
+ bundler
57
+ deferring!
58
+ rake
59
+ rspec
60
+ sqlite3
61
+
62
+ BUNDLED WITH
63
+ 2.2.32
@@ -1,3 +1,3 @@
1
1
  module Deferring
2
- VERSION = '0.8.1'
2
+ VERSION = '0.8.2'
3
3
  end
data/lib/deferring.rb CHANGED
@@ -238,7 +238,13 @@ module Deferring
238
238
  unless record.valid?
239
239
  valid = false
240
240
  if autosave
241
- if ActiveRecord::VERSION::MAJOR == 6 && ActiveRecord::VERSION::MINOR == 1
241
+ if ActiveRecord.version.release < Gem::Version.new('6.1.0')
242
+ record.errors.each do |attribute, message|
243
+ attribute = "#{association_name}.#{attribute}"
244
+ errors[attribute] << message
245
+ errors[attribute].uniq!
246
+ end
247
+ else # >= Rails 6.1
242
248
  record.errors.group_by_attribute.each do |attribute, errors|
243
249
  errors.each do |error|
244
250
  self.errors.import(
@@ -247,12 +253,6 @@ module Deferring
247
253
  )
248
254
  end
249
255
  end
250
- else
251
- record.errors.each do |attribute, message|
252
- attribute = "#{association_name}.#{attribute}"
253
- errors[attribute] << message
254
- errors[attribute].uniq!
255
- end
256
256
  end
257
257
  else
258
258
  errors.add(association_name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deferring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Roestenburg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-28 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -109,6 +109,8 @@ files:
109
109
  - gemfiles/rails_60.gemfile.lock
110
110
  - gemfiles/rails_61.gemfile
111
111
  - gemfiles/rails_61.gemfile.lock
112
+ - gemfiles/rails_70.gemfile
113
+ - gemfiles/rails_70.gemfile.lock
112
114
  - lib/deferring.rb
113
115
  - lib/deferring/deferred_association.rb
114
116
  - lib/deferring/deferred_callback_listener.rb