Skip to content

Commit d1fc0a5

Browse files
committed
Removed deprecated support to passing the adapter class to .queue_adapter
1 parent d861a1f commit d1fc0a5

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

activejob/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Removed deprecated support to passing the adapter class to `.queue_adapter`.
2+
3+
*Rafael Mendonça França*
4+
15
* Removed deprecated `#original_exception` in `ActiveJob::DeserializationError`.
26

37
*Rafael Mendonça França*

activejob/lib/active_job/queue_adapter.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ def interpret_adapter(name_or_adapter_or_class)
3737
else
3838
if queue_adapter?(name_or_adapter_or_class)
3939
name_or_adapter_or_class
40-
elsif queue_adapter_class?(name_or_adapter_or_class)
41-
ActiveSupport::Deprecation.warn "Passing an adapter class is deprecated " \
42-
"and will be removed in Rails 5.1. Please pass an adapter name " \
43-
"(.queue_adapter = :#{name_or_adapter_or_class.name.demodulize.remove('Adapter').underscore}) " \
44-
"or an instance (.queue_adapter = #{name_or_adapter_or_class.name}.new) instead."
45-
name_or_adapter_or_class.new
4640
else
4741
raise ArgumentError
4842
end
@@ -54,10 +48,6 @@ def interpret_adapter(name_or_adapter_or_class)
5448
def queue_adapter?(object)
5549
QUEUE_ADAPTER_METHODS.all? { |meth| object.respond_to?(meth) }
5650
end
57-
58-
def queue_adapter_class?(object)
59-
object.is_a?(Class) && QUEUE_ADAPTER_METHODS.all? { |meth| object.public_method_defined?(meth) }
60-
end
6151
end
6252
end
6353
end

activejob/test/cases/queue_adapter_test.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ class QueueAdapterTest < ActiveJob::TestCase
2020
assert_raises(ArgumentError) { ActiveJob::Base.queue_adapter = Mutex.new }
2121
end
2222

23-
test "should warn on passing an adapter class" do
24-
klass = Class.new do
25-
def self.name
26-
"fake"
27-
end
28-
29-
def enqueue(*); end
30-
def enqueue_at(*); end
31-
end
32-
33-
assert_deprecated { ActiveJob::Base.queue_adapter = klass }
34-
end
35-
3623
test "should allow overriding the queue_adapter at the child class level without affecting the parent or its sibling" do
3724
base_queue_adapter = ActiveJob::Base.queue_adapter
3825

0 commit comments

Comments
 (0)