Skip to content

Commit

Permalink
Merge pull request #16700 from seuros/autoload
Browse files Browse the repository at this point in the history
[ActiveJob] Autoload adapters
  • Loading branch information
rafaelfranca committed Aug 26, 2014
2 parents 2c84512 + 7e99855 commit 14e2bbf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion activejob/lib/active_job.rb
Expand Up @@ -30,4 +30,5 @@ module ActiveJob
extend ActiveSupport::Autoload

autoload :Base
end
autoload :QueueAdapters
end
1 change: 0 additions & 1 deletion activejob/lib/active_job/queue_adapter.rb
Expand Up @@ -17,7 +17,6 @@ def queue_adapter=(name_or_adapter)

private
def load_adapter(name)
require "active_job/queue_adapters/#{name}_adapter"
"ActiveJob::QueueAdapters::#{name.to_s.camelize}Adapter".constantize
end
end
Expand Down
16 changes: 16 additions & 0 deletions activejob/lib/active_job/queue_adapters.rb
@@ -0,0 +1,16 @@
module ActiveJob
module QueueAdapters
extend ActiveSupport::Autoload

autoload :InlineAdapter
autoload :BackburnerAdapter
autoload :DelayedJobAdapter
autoload :QuAdapter
autoload :QueAdapter
autoload :QueueClassicAdapter
autoload :ResqueAdapter
autoload :SidekiqAdapter
autoload :SneakersAdapter
autoload :SuckerPunchAdapter
end
end

0 comments on commit 14e2bbf

Please sign in to comment.