Permalink
Browse files

Updating deprecated_body.rb to use :content instead of :data or :body…

… in the params hash
  • Loading branch information...
1 parent 77986f6 commit 90bbed233e14957376d6c1985202c495b3af6ed4 @mikel mikel committed Jan 22, 2010
Showing with 8 additions and 3 deletions.
  1. +8 −3 actionmailer/lib/action_mailer/deprecated_body.rb
@@ -14,10 +14,15 @@ def initialize_defaults(method_name)
end
def attachment(params, &block)
+ if params[:data]
+ ActiveSupport::Deprecation.warn('attachment :data => "string" is deprecated. To set the body of an attachment ' <<
+ 'please use :content instead, like attachment :content => "string"', caller[0,10])
+ params[:content] = params.delete(:data)
+ end
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)
+ ActiveSupport::Deprecation.warn('attachment :data => "string" is deprecated. To set the body of an attachment ' <<
+ 'please use :content instead, like attachment :content => "string"', caller[0,10])
+ params[:content] = params.delete(:body)
end
end

0 comments on commit 90bbed2

Please sign in to comment.