diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-22 21:10:52 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-22 21:10:52 +1100 |
commit | 1170e70797e06b3f062e222d912b0cc1dd6072e5 (patch) | |
tree | 5b46b0cc33e00137f3ac505f7d854895093b7b5c /actionmailer/lib/action_mailer/deprecated_body.rb | |
parent | 6fd7d1fc128f1d6d7bddaa6770739d7e936dd049 (diff) | |
parent | bb9d71ff9e537597ff4d5962e7870ad99001f605 (diff) | |
download | rails-1170e70797e06b3f062e222d912b0cc1dd6072e5.tar.gz rails-1170e70797e06b3f062e222d912b0cc1dd6072e5.tar.bz2 rails-1170e70797e06b3f062e222d912b0cc1dd6072e5.zip |
Merge branch 'master' of github.com:mikel/rails
Diffstat (limited to 'actionmailer/lib/action_mailer/deprecated_body.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/deprecated_body.rb | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/actionmailer/lib/action_mailer/deprecated_body.rb b/actionmailer/lib/action_mailer/deprecated_body.rb deleted file mode 100644 index daaf145327..0000000000 --- a/actionmailer/lib/action_mailer/deprecated_body.rb +++ /dev/null @@ -1,53 +0,0 @@ -module ActionMailer - # TODO Remove this module all together in a next release. Ensure that super - # hooks in ActionMailer::Base are removed as well. - module DeprecatedBody - extend ActionMailer::AdvAttrAccessor - - # Define the body of the message. This is either a Hash (in which case it - # specifies the variables to pass to the template when it is rendered), - # or a string, in which case it specifies the actual text of the message. - adv_attr_accessor :body - - def initialize_defaults(method_name) - @body ||= {} - 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 :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 - - def create_parts - if String === @body - ActiveSupport::Deprecation.warn('body(String) is deprecated. To set the body with a text ' << - 'call render(:text => "body")', caller[0,10]) - self.response_body = @body - elsif @body.is_a?(Hash) && !@body.empty? - ActiveSupport::Deprecation.warn('body(Hash) is deprecated. Use instance variables to define ' << - 'assigns in your view', caller[0,10]) - @body.each { |k, v| instance_variable_set(:"@#{k}", v) } - end - end - - def render(*args) - options = args.last.is_a?(Hash) ? args.last : {} - if options[:body] - ActiveSupport::Deprecation.warn(':body in render deprecated. Please call body ' << - 'with a hash instead', caller[0,1]) - - body options.delete(:body) - end - - super - end - end -end |