Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating nulldb adapater for 7.1.2 compatibility #32

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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