diff options
Diffstat (limited to 'lib/active_job/base.rb')
-rw-r--r-- | lib/active_job/base.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/active_job/base.rb b/lib/active_job/base.rb index e18c9d4309..341ea6158b 100644 --- a/lib/active_job/base.rb +++ b/lib/active_job/base.rb @@ -3,12 +3,18 @@ require 'active_job/queue_adapters/resque_adapter' module ActiveJob class Base - cattr_accessor(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter } - + cattr_accessor(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter } + cattr_accessor(:queue_base_name) { "active_jobs" } + cattr_accessor(:queue_name) { queue_base_name } + class << self def enqueue(*args) queue_adapter.queue self, *args end + + def queue_as(part_name) + self.queue_name = "#{queue_base_name}_#{part_name}" + end end end end
\ No newline at end of file |