Skip to content

Commit

Permalink
Updating deprecated_body.rb to use :content instead of :data or :body…
Browse files Browse the repository at this point in the history
… in the params hash
  • Loading branch information
mikel committed Jan 22, 2010
1 parent 77986f6 commit 90bbed2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions actionmailer/lib/action_mailer/deprecated_body.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ def initialize_defaults(method_name)
end end


def attachment(params, &block) 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] if params[:body]
ActiveSupport::Deprecation.warn('attachment :body => "string" is deprecated. To set the body of an attachment ' << ActiveSupport::Deprecation.warn('attachment :data => "string" is deprecated. To set the body of an attachment ' <<
'please use :data instead, like attachment :data => "string"', caller[0,10]) 'please use :content instead, like attachment :content => "string"', caller[0,10])
params[:data] = params.delete(:body) params[:content] = params.delete(:body)
end end
end end


Expand Down

0 comments on commit 90bbed2

Please sign in to comment.