aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/queue_name.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/lib/active_job/queue_name.rb')
-rw-r--r--activejob/lib/active_job/queue_name.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activejob/lib/active_job/queue_name.rb b/activejob/lib/active_job/queue_name.rb
index c2186d9fe9..9698835b6e 100644
--- a/activejob/lib/active_job/queue_name.rb
+++ b/activejob/lib/active_job/queue_name.rb
@@ -3,10 +3,13 @@ module ActiveJob
extend ActiveSupport::Concern
module ClassMethods
+ mattr_accessor(:queue_name_prefix)
mattr_accessor(:default_queue_name) { "default" }
def queue_as(part_name)
- self.queue_name = part_name.to_s.presence || default_queue_name
+ queue_name = part_name.to_s.presence || default_queue_name
+ name_parts = [queue_name_prefix.presence, queue_name]
+ self.queue_name = name_parts.compact.join('_')
end
end