Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a factory method for queue construction so that apps can have mul…

…tiple queues
  • Loading branch information...
commit cd50b60431881b808d596f394befd38a2d453603 1 parent 8de4d71
Aaron Patterson tenderlove authored
6 railties/lib/rails/application.rb
View
@@ -200,7 +200,11 @@ def config #:nodoc:
end
def queue #:nodoc:
- @queue ||= config.queue.new
+ @queue ||= build_queue
+ end
+
+ def build_queue # :nodoc:
+ config.queue.new
end
def to_app
8 railties/test/application/configuration_test.rb
View
@@ -41,6 +41,14 @@ def teardown
FileUtils.rm_rf(new_app) if File.directory?(new_app)
end
+ test "multiple queue construction is possible" do
+ require 'rails'
+ require "#{app_path}/config/environment"
+ mail_queue = Rails.application.build_queue
+ image_processing_queue = Rails.application.build_queue
+ assert_not_equal mail_queue, image_processing_queue
+ end
+
test "Rails.groups returns available groups" do
require "rails"
Please sign in to comment.
Something went wrong with that request. Please try again.