From 45537f00b4b412d4dc6f9ae746aa24346e6b705a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Sep 2012 14:23:07 -0300 Subject: Allow users to configure the queue for the mailers This allow the users to do: config.action_mailer.queue = MyQueue.new and class UsersMailer < ActionMailer::Base self.queue = MyQueue.new end --- actionmailer/lib/action_mailer/base.rb | 7 ++----- actionmailer/lib/action_mailer/railtie.rb | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 35ac0423a5..9cc00ca5a1 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -389,6 +389,8 @@ module ActionMailer #:nodoc: :parts_order => [ "text/plain", "text/enriched", "text/html" ] }.freeze + class_attribute :queue + class << self # Register one or more Observers which will be notified when mail is delivered. def register_observers(*observers) @@ -486,11 +488,6 @@ module ActionMailer #:nodoc: super end end - - def queue - Rails.queue - end - end attr_internal :message diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb index 8679096735..1fa689de5b 100644 --- a/actionmailer/lib/action_mailer/railtie.rb +++ b/actionmailer/lib/action_mailer/railtie.rb @@ -19,6 +19,8 @@ module ActionMailer options.javascripts_dir ||= paths["public/javascripts"].first options.stylesheets_dir ||= paths["public/stylesheets"].first + options.queue ||= app.queue + # make sure readers methods get compiled options.asset_path ||= app.config.asset_path options.asset_host ||= app.config.asset_host -- cgit v1.2.3