Updating deprecated_body.rb to use :content instead of :data or :body in the params hash

This commit is contained in:
José Valim and Mikel Lindsaar
2010-01-22 12:51:07 +11:00
parent 77986f6bdb
commit 90bbed233e

View File

@@ -14,10 +14,15 @@ module ActionMailer
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