diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-28 19:46:58 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-28 19:46:58 -0200 |
commit | d80ed79e99e276708978b9ebd26786bc9a79f46d (patch) | |
tree | 7d366a5c010add5b40723b943ecc39dd43545f2d /activejob/lib/active_job/queue_name.rb | |
parent | 777142d3a7b9ea36fcc8562613749299ac6dc243 (diff) | |
parent | 11ab04b11170253e96515c3ada6f2566b092533a (diff) | |
download | rails-d80ed79e99e276708978b9ebd26786bc9a79f46d.tar.gz rails-d80ed79e99e276708978b9ebd26786bc9a79f46d.tar.bz2 rails-d80ed79e99e276708978b9ebd26786bc9a79f46d.zip |
Merge pull request #17039 from zv1n/add_prefix_delimiter
Added ability to configure the queue_name_prefix delimiter to ActiveJob::QueueName.
Diffstat (limited to 'activejob/lib/active_job/queue_name.rb')
-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 |