diff options
Diffstat (limited to 'activejob')
-rw-r--r-- | activejob/CHANGELOG.md | 8 | ||||
-rw-r--r-- | activejob/lib/active_job/arguments.rb | 14 | ||||
-rw-r--r-- | activejob/lib/active_job/queue_adapter.rb | 10 | ||||
-rw-r--r-- | activejob/test/cases/queue_adapter_test.rb | 13 |
4 files changed, 9 insertions, 36 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index ef62b2136b..5e8d8cb5c9 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,3 +1,11 @@ +* Removed deprecated support to passing the adapter class to `.queue_adapter`. + + *Rafael Mendonça França* + +* Removed deprecated `#original_exception` in `ActiveJob::DeserializationError`. + + *Rafael Mendonça França* + * Added instance variable `@queue` to JobWrapper. This will fix issues in [resque-scheduler](https://github.com/resque/resque-scheduler) `#job_to_hash` method, diff --git a/activejob/lib/active_job/arguments.rb b/activejob/lib/active_job/arguments.rb index 23e237c1b7..523a0e7f33 100644 --- a/activejob/lib/active_job/arguments.rb +++ b/activejob/lib/active_job/arguments.rb @@ -5,22 +5,10 @@ module ActiveJob # # Wraps the original exception raised as +cause+. class DeserializationError < StandardError - def initialize(e = nil) #:nodoc: - if e - ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \ - "Exceptions will automatically capture the original exception.", caller) - end - + def initialize #:nodoc: super("Error while trying to deserialize arguments: #{$!.message}") set_backtrace $!.backtrace end - - # The original exception that was raised during deserialization of job - # arguments. - def original_exception - ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller) - cause - end end # Raised when an unsupported argument type is set as a job argument. We diff --git a/activejob/lib/active_job/queue_adapter.rb b/activejob/lib/active_job/queue_adapter.rb index 7f9a2da4b0..2e9f1e61be 100644 --- a/activejob/lib/active_job/queue_adapter.rb +++ b/activejob/lib/active_job/queue_adapter.rb @@ -37,12 +37,6 @@ module ActiveJob else if queue_adapter?(name_or_adapter_or_class) name_or_adapter_or_class - elsif queue_adapter_class?(name_or_adapter_or_class) - ActiveSupport::Deprecation.warn "Passing an adapter class is deprecated " \ - "and will be removed in Rails 5.1. Please pass an adapter name " \ - "(.queue_adapter = :#{name_or_adapter_or_class.name.demodulize.remove('Adapter').underscore}) " \ - "or an instance (.queue_adapter = #{name_or_adapter_or_class.name}.new) instead." - name_or_adapter_or_class.new else raise ArgumentError end @@ -54,10 +48,6 @@ module ActiveJob def queue_adapter?(object) QUEUE_ADAPTER_METHODS.all? { |meth| object.respond_to?(meth) } end - - def queue_adapter_class?(object) - object.is_a?(Class) && QUEUE_ADAPTER_METHODS.all? { |meth| object.public_method_defined?(meth) } - end end end end diff --git a/activejob/test/cases/queue_adapter_test.rb b/activejob/test/cases/queue_adapter_test.rb index dc862450aa..f1e0cf78ad 100644 --- a/activejob/test/cases/queue_adapter_test.rb +++ b/activejob/test/cases/queue_adapter_test.rb @@ -20,19 +20,6 @@ class QueueAdapterTest < ActiveJob::TestCase assert_raises(ArgumentError) { ActiveJob::Base.queue_adapter = Mutex.new } end - test "should warn on passing an adapter class" do - klass = Class.new do - def self.name - "fake" - end - - def enqueue(*); end - def enqueue_at(*); end - end - - assert_deprecated { ActiveJob::Base.queue_adapter = klass } - end - test "should allow overriding the queue_adapter at the child class level without affecting the parent or its sibling" do base_queue_adapter = ActiveJob::Base.queue_adapter |