From cc391c30227564032398f24417bba21ab1a3d66a Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Mon, 23 Nov 2009 20:53:07 +1100 Subject: Deprecating attachment :body => 'string' in favour of attachment :data => 'string' --- actionmailer/lib/action_mailer/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index bf5e15e0e5..af3ef877b2 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -386,7 +386,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 -- cgit v1.2.3