Skip to content

Commit

Permalink
Merge pull request #32 from smasry/rails_7_1_2_compatibility
Browse files Browse the repository at this point in the history
Updating nulldb adapater for 7.1.2 compatibility
  • Loading branch information
adamstegman authored Dec 14, 2023
2 parents 7bf660e + a607c4b commit 0b16502
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion acts_as_scrubbable.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'guard-rspec' , '~> 4.6'
s.add_development_dependency 'pry-byebug' , '~> 3.2'
s.add_development_dependency 'terminal-notifier-guard' , '~> 1.6'
s.add_development_dependency 'activerecord-nulldb-adapter', '~> 0.3'
s.add_development_dependency 'activerecord-nulldb-adapter', '~> 1.0'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_scrubbable/ar_class_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def process(num_of_batches)
end

ActsAsScrubbable.logger.info Term::ANSIColor.blue("#{scrubbed_count} #{ar_class} objects scrubbed")
ActiveRecord::Base.connection.verify!
ActiveRecord::Base.connection.verify! unless ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::NullDBAdapter)

ActsAsScrubbable.logger.info Term::ANSIColor.white("Scrub Complete!")
end
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_scrubbable/task_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def scrub(num_of_batches: nil, skip_before_hooks: false, skip_after_hooks: false
Parallel.each(ar_classes) do |ar_class|
ActsAsScrubbable::ArClassProcessor.new(ar_class).process(num_of_batches)
end
ActiveRecord::Base.connection.verify!
ActiveRecord::Base.connection.verify! unless ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::NullDBAdapter)

after_hooks unless skip_after_hooks
end
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_scrubbable/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActsAsScrubbable
VERSION = '2.1.1'
VERSION = '2.1.2'
end
1 change: 0 additions & 1 deletion spec/lib/acts_as_scrubbable/ar_class_processor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
end

it "calls the expected helper classes with the expected batch size" do
expect(ActiveRecord::Base.connection).to receive(:verify!)
expect(update_processor_mock).to receive(:scrub_query).with(query)
subject.process(num_of_batches)
expect(ActsAsScrubbable::ParallelTableScrubber).to have_received(:new).with(ar_class, 256)
Expand Down

0 comments on commit 0b16502

Please sign in to comment.