diff --git a/lib/active_job/base.rb b/lib/active_job/base.rb index f39dba6f5f..86008d3c94 100644 --- a/lib/active_job/base.rb +++ b/lib/active_job/base.rb @@ -1,9 +1,7 @@ -require 'active_job/errors' require 'active_job/queue_adapters/inline_adapter' require 'active_support/core_ext/string/inflections' module ActiveJob - class Base cattr_accessor(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter } cattr_accessor(:queue_base_name) { "active_jobs" } @@ -19,19 +17,9 @@ module ActiveJob end def adapter=(adapter_name) - adapter_name = adapter_name.to_s - unless %w(inline resque sidekiq sucker_punch).include?(adapter_name) - fail ActiveJob::NotImplementedError - end - - begin - require_relative "queue_adapters/#{adapter_name}_adapter" - ActiveJob::Base.queue_adapter = "ActiveJob::QueueAdapters::#{adapter_name.camelize}Adapter".constantize - rescue - fail ActiveJob::Error.new("#{adapter_name} is missing") - end + require "active_job/queue_adapters/#{adapter_name}_adapter" + ActiveJob::Base.queue_adapter = "ActiveJob::QueueAdapters::#{adapter_name.to_s.camelize}Adapter".constantize end end - end end \ No newline at end of file diff --git a/lib/active_job/errors.rb b/lib/active_job/errors.rb deleted file mode 100644 index 4fc3be6878..0000000000 --- a/lib/active_job/errors.rb +++ /dev/null @@ -1,12 +0,0 @@ -module ActiveJob - - class NotImplementedError < ::NotImplementedError #:nodoc: - end - - class Error < ::StandardError #:nodoc: - def initialize(message = nil) - super(message) - end - end - -end \ No newline at end of file