aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/deprecated_body.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-27 12:09:20 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-27 12:09:20 +0100
commit47e5caa96bffc04c8c0b287a975a609fb048e530 (patch)
tree653d360dc9ad7eb7c5d2338840e15ab8b28a902b /actionmailer/lib/action_mailer/deprecated_body.rb
parentfd58a2d1da04508a7fdf825143e61d186112e63e (diff)
parentd92c4a84023bc0c8dd75869c9b4d5e50277f4650 (diff)
downloadrails-47e5caa96bffc04c8c0b287a975a609fb048e530.tar.gz
rails-47e5caa96bffc04c8c0b287a975a609fb048e530.tar.bz2
rails-47e5caa96bffc04c8c0b287a975a609fb048e530.zip
Merge Mail with latest Rails and move mail gem to Gemfile.
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 ' <<