diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-12 14:23:07 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-12 15:32:22 -0300 |
commit | 45537f00b4b412d4dc6f9ae746aa24346e6b705a (patch) | |
tree | 7d1fea890d11a8ef0c123e34a053d3d9bbb0b010 /actionmailer/lib | |
parent | 9bb4850e7bf864e0277140ab6d3d4ae67ef68170 (diff) | |
download | rails-45537f00b4b412d4dc6f9ae746aa24346e6b705a.tar.gz rails-45537f00b4b412d4dc6f9ae746aa24346e6b705a.tar.bz2 rails-45537f00b4b412d4dc6f9ae746aa24346e6b705a.zip |
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
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 7 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/railtie.rb | 2 |
2 files changed, 4 insertions, 5 deletions
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 |