diff --git a/lib/acts_as_scrubbable/ar_class_processor.rb b/lib/acts_as_scrubbable/ar_class_processor.rb index 1faa0da..36c805e 100644 --- a/lib/acts_as_scrubbable/ar_class_processor.rb +++ b/lib/acts_as_scrubbable/ar_class_processor.rb @@ -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! unless ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::NullDBAdapter) + ActiveRecord::Base.connection.verify! if ActiveRecord::Base.connection.respond_to?(:reconnect) ActsAsScrubbable.logger.info Term::ANSIColor.white("Scrub Complete!") end diff --git a/lib/acts_as_scrubbable/task_runner.rb b/lib/acts_as_scrubbable/task_runner.rb index 3c6e9f6..98b8ef4 100644 --- a/lib/acts_as_scrubbable/task_runner.rb +++ b/lib/acts_as_scrubbable/task_runner.rb @@ -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! unless ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::NullDBAdapter) + ActiveRecord::Base.connection.verify! if ActiveRecord::Base.connection.respond_to?(:reconnect) after_hooks unless skip_after_hooks end diff --git a/lib/acts_as_scrubbable/version.rb b/lib/acts_as_scrubbable/version.rb index b656e41..10a41e1 100644 --- a/lib/acts_as_scrubbable/version.rb +++ b/lib/acts_as_scrubbable/version.rb @@ -1,3 +1,3 @@ module ActsAsScrubbable - VERSION = '2.1.2' + VERSION = '2.1.3' end