diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-23 15:29:35 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-23 15:29:35 -0800 |
commit | 671538cd6ea0bd4c463e7bf7d238a55924a8af53 (patch) | |
tree | 661710f2df243f02452846c3e85f2980acbf813a /actionmailer/lib/action_mailer/base.rb | |
parent | ca5de16ddc50b4f8d8a88e91571f5c5a2c8c751c (diff) | |
parent | 3a72923e27195983d37bdb39ef26b29cf03d3483 (diff) | |
download | rails-671538cd6ea0bd4c463e7bf7d238a55924a8af53.tar.gz rails-671538cd6ea0bd4c463e7bf7d238a55924a8af53.tar.bz2 rails-671538cd6ea0bd4c463e7bf7d238a55924a8af53.zip |
Merge commit 'mikel/master' into mail
Conflicts:
actionmailer/lib/action_mailer.rb
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 9d7af72362..3639992ce9 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -251,7 +251,7 @@ module ActionMailer #:nodoc: # and appear last in the mime encoded message. You can also pick a different order from inside a method with # +implicit_parts_order+. class Base - include AdvAttrAccessor, Quoting, Utils + include AdvAttrAccessor, Quoting include AbstractController::RenderingController include AbstractController::LocalizedCache @@ -372,8 +372,9 @@ module ActionMailer #:nodoc: def part(params) params = {:content_type => params} if String === params if custom_headers = params.delete(:headers) - STDERR.puts("Passing custom headers with :headers => {} is deprecated. Please just pass in custom headers directly.") - params = params.merge(custom_headers) + ActiveSupport::Deprecation.warn('Passing custom headers with :headers => {} is deprecated. ' << + 'Please just pass in custom headers directly.', caller[0,10]) + params.merge!(custom_headers) end part = Mail::Part.new(params) yield part if block_given? @@ -386,7 +387,11 @@ module ActionMailer #:nodoc: params = { :content_type => params } if String === params params = { :content_disposition => "attachment", :content_transfer_encoding => "base64" }.merge(params) - params[:data] = params.delete(:body) if params[:body] + if params[:body] + ActiveSupport::Deprecation.warn('attachment :body => "string" is deprecated. To set the body of an attachment ' << + 'please use :data instead, like attachment :data => "string".', caller[0,10]) + params[:data] = params.delete(:body) + end part(params, &block) end @@ -619,11 +624,11 @@ module ActionMailer #:nodoc: if @parts.empty? main_type, sub_type = split_content_type(real_content_type) m.content_type([main_type, sub_type, ctype_attrs]) - m.body = normalize_new_lines(body) + m.body = body elsif @parts.size == 1 && @parts.first.parts.empty? main_type, sub_type = split_content_type(real_content_type) m.content_type([main_type, sub_type, ctype_attrs]) - m.body = normalize_new_lines(@parts.first.body) + m.body = @parts.first.body.encoded else @parts.each do |p| m.add_part(p) |