aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/deprecated_body.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/lib/action_mailer/deprecated_body.rb')
-rw-r--r--actionmailer/lib/action_mailer/deprecated_body.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/deprecated_body.rb b/actionmailer/lib/action_mailer/deprecated_body.rb
index 50ff262432..20b0989a85 100644
--- a/actionmailer/lib/action_mailer/deprecated_body.rb
+++ b/actionmailer/lib/action_mailer/deprecated_body.rb
@@ -15,6 +15,14 @@ module ActionMailer
@body ||= {}
end
+ def attachment(params, &block)
+ 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
+ end
+
def create_parts
if String === @body
ActiveSupport::Deprecation.warn('body is deprecated. To set the body with a text ' <<