activerecord-import 1.8.0 → 1.8.1

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: d1478b29daf1e757c91a0ca8693bb1b03f9a90daa2fe02f0959576bcec900d85
4
- data.tar.gz: dc938a1936c931182675a118ad24a37e2a7c5a27c0419e5bd947e0ec35aa4334
3
+ metadata.gz: 021d7d0d5b653ef01a5ab1aa23b72cca6f46abc65040014ad02fa790976f0189
4
+ data.tar.gz: a5440146848bc1bfee194681b9bf53f928150936c3c992eaec1299fec2e7c1bb
5
5
  SHA512:
6
- metadata.gz: e276196113f433c8989a9a06cfad36df650105183a5559a548bdd8a04bd2da22db36ca996d2d0d04c4561b33ceb44559b50b4ad98e0a2d9f050b8084ee99c8e6
7
- data.tar.gz: e699052ac2499bac23a9955fef71df853050767785d573523e23a1d216cfba9cb75b81b0db9f5e2afac02afbcb416563af6e7a2bf69f6d1288c6e6c71aeb7e5c
6
+ metadata.gz: 460961724684bc286a63ff0880ee8279a5a1528cd02ebd28e4694b8d7c39c22f19183f929ecd525de57a5069bf45218428aae47fd96ea5782e7b51a85aee0e1f
7
+ data.tar.gz: b864f8eb6fc2a074497761813f29aca981ec23daa7ae12164f1b34a08bbad6175025e6a551575ef2f53f7521f13d15de02eccb24f36c2e18dcdb04fdf77e53a7
@@ -141,7 +141,7 @@ jobs:
141
141
  - uses: actions/checkout@v4
142
142
  - uses: ruby/setup-ruby@v1
143
143
  with:
144
- ruby-version: 2.7
144
+ ruby-version: 3.0
145
145
  bundler-cache: true
146
146
  - name: Run Rubocop
147
147
  run: bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ AllCops:
4
+ TargetRubyVersion: 3.0.x
5
+
3
6
  Metrics/AbcSize:
4
7
  Enabled: false
5
8
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## Changes in 1.8.1
2
+
3
+ ### Fixes
4
+
5
+ * Further update for ActiveRecord 7.2 compatibility when running validations. Thanks to @denisahearn via \##847.
6
+
1
7
  ## Changes in 1.8.0
2
8
 
3
9
  ### New Features
@@ -10,7 +10,7 @@ require 'ostruct'
10
10
  # * t - the table types to test. ie: myisam, innodb, memory, temporary, etc.
11
11
  #
12
12
  module BenchmarkOptionParser
13
- BANNER = "Usage: ruby #{$0} [options]\nSee ruby #{$0} -h for more options."
13
+ BANNER = "Usage: ruby #{$0} [options]\nSee ruby #{$0} -h for more options.".freeze
14
14
 
15
15
  def self.print_banner
16
16
  puts BANNER
@@ -94,7 +94,7 @@ module ActiveRecord::Import # :nodoc:
94
94
  env = ActiveSupport::Callbacks::Filters::Environment.new(model, false, nil)
95
95
  if runner.respond_to?(:call) # ActiveRecord < 5.1
96
96
  runner.call(env)
97
- else # ActiveRecord 5.1
97
+ else # ActiveRecord >= 5.1
98
98
  # Note that this is a gross simplification of ActiveSupport::Callbacks#run_callbacks.
99
99
  # It's technically possible for there to exist an "around" callback in the
100
100
  # :validate chain, but this would be an aberration, since Rails doesn't define
@@ -107,7 +107,8 @@ module ActiveRecord::Import # :nodoc:
107
107
  # no real-world use case for it.
108
108
  raise "The :validate callback chain contains an 'around' callback, which is unsupported" unless runner.final?
109
109
  runner.invoke_before(env)
110
- runner.invoke_after(env)
110
+ # Ensure a truthy value is returned. ActiveRecord < 7.2 always returned an array.
111
+ runner.invoke_after(env) || []
111
112
  end
112
113
  elsif @validate_callbacks.method(:compile).arity == 0 # ActiveRecord = 4.0
113
114
  model.instance_eval @validate_callbacks.compile
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module Import
5
- VERSION = "1.8.0"
5
+ VERSION = "1.8.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-23 00:00:00.000000000 Z
11
+ date: 2024-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubygems_version: 3.5.11
205
+ rubygems_version: 3.3.9
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: Bulk insert extension for ActiveRecord