Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 2742

Show
Ignore:
Timestamp:
10/26/05 13:02:58 (3 years ago)
Author:
david
Message:

Allow Mailers to have custom initialize methods that set default instance variables for all mail actions (closes #2563) [mrj@bigpond.net.au]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionmailer/CHANGELOG

    r2737 r2742  
     1*SVN* 
     2 
     3* Allow Mailers to have custom initialize methods that set default instance variables for all mail actions #2563 [mrj@bigpond.net.au] 
     4 
     5 
    16*1.1.2* (October 26th, 2005) 
    27 
  • trunk/actionmailer/lib/action_mailer/base.rb

    r2648 r2742  
    338338      # defaults. 
    339339      def initialize_defaults(method_name) 
    340         @bcc = @cc = @from = @recipients = @sent_on = @subject = nil 
    341         @charset = @@default_charset.dup 
    342         @content_type = @@default_content_type.dup 
    343         @implicit_parts_order = @@default_implicit_parts_order.dup 
    344         @template = method_name 
    345         @mailer_name = Inflector.underscore(self.class.name) 
    346         @parts = [] 
    347         @headers = {} 
    348         @body = {} 
     340        @charset ||= @@default_charset.dup 
     341        @content_type ||= @@default_content_type.dup 
     342        @implicit_parts_order ||= @@default_implicit_parts_order.dup 
     343        @template ||= method_name 
     344        @mailer_name ||= Inflector.underscore(self.class.name) 
     345        @parts ||= [] 
     346        @headers ||= {} 
     347        @body ||= {} 
    349348        @mime_version = @@default_mime_version.dup if @@default_mime_version 
    350349      end