diff options
author | Terry Meacham <zv1n.fire@gmail.com> | 2014-09-23 15:51:44 -0500 |
---|---|---|
committer | Terry Meacham <zv1n.fire@gmail.com> | 2014-10-26 21:46:05 -0500 |
commit | 11ab04b11170253e96515c3ada6f2566b092533a (patch) | |
tree | ce22987d118a311aef27a734357314b9994f58ef /activejob/lib | |
parent | 85faea4b8320e728854838c6da97c9435de8869e (diff) | |
download | rails-11ab04b11170253e96515c3ada6f2566b092533a.tar.gz rails-11ab04b11170253e96515c3ada6f2566b092533a.tar.bz2 rails-11ab04b11170253e96515c3ada6f2566b092533a.zip |
Added queue_name_delimiter attribute.
- Added ActiveJob::Base#queue_name_delimiter to allow for
developers using ActiveJob to change the delimiter from the default
('_') to whatever else they may be using (e.g., '.', '-', ...).
- Updated source guide to include a blurb about the delimiter.
Diffstat (limited to 'activejob/lib')
-rw-r--r-- | activejob/lib/active_job/queue_name.rb | 5 |
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 d167617e4e..6ee7142ce6 100644 --- a/activejob/lib/active_job/queue_name.rb +++ b/activejob/lib/active_job/queue_name.rb @@ -26,13 +26,16 @@ module ActiveJob def queue_name_from_part(part_name) #:nodoc: queue_name = part_name || default_queue_name name_parts = [queue_name_prefix.presence, queue_name] - name_parts.compact.join('_') + name_parts.compact.join(queue_name_delimiter) end end included do class_attribute :queue_name, instance_accessor: false + class_attribute :queue_name_delimiter, instance_accessor: false + self.queue_name = default_queue_name + self.queue_name_delimiter = '_' # set default delimiter to '_' end # Returns the name of the queue the job will be run on |