Skip to content

Commit a8cbb96

Browse files
committed
make that a private instance method instead
1 parent d258bfe commit a8cbb96

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

activejob/lib/active_job/callbacks.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,17 @@ def after_enqueue(*filters, &blk)
163163
def around_enqueue(*filters, &blk)
164164
set_callback(:enqueue, :around, *filters, &blk)
165165
end
166+
end
166167

168+
private
167169
def warn_against_after_callbacks_execution_deprecation(callbacks) # :nodoc:
168-
if !skip_after_callbacks_if_terminated && callbacks.any? { |c| c.kind == :after }
170+
if !self.class.skip_after_callbacks_if_terminated && callbacks.any? { |c| c.kind == :after }
169171
ActiveSupport::Deprecation.warn(<<~EOM)
170172
In Rails 6.2, `after_enqueue`/`after_perform` callbacks no longer run if `before_enqueue`/`before_perform` respectively halts with `throw :abort`.
171173
To enable this behavior, uncomment the `config.active_job.skip_after_callbacks_if_terminated` config
172174
in the new 6.1 framework defaults initializer.
173175
EOM
174176
end
175177
end
176-
end
177178
end
178179
end

activejob/lib/active_job/enqueuing.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def enqueue(options = {})
6363
if successfully_enqueued
6464
self
6565
else
66-
self.class.warn_against_after_callbacks_execution_deprecation(_enqueue_callbacks)
66+
warn_against_after_callbacks_execution_deprecation(_enqueue_callbacks)
6767

6868
if self.class.return_false_on_aborted_enqueue
6969
false

activejob/lib/active_job/execution.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def perform_now
4242
successfully_performed = true
4343
end
4444

45-
self.class.warn_against_after_callbacks_execution_deprecation(_perform_callbacks) unless successfully_performed
45+
warn_against_after_callbacks_execution_deprecation(_perform_callbacks) unless successfully_performed
4646
successfully_performed
4747
rescue => exception
4848
rescue_with_handler(exception) || raise

0 commit comments

Comments
 (0)