Permalink
Browse files

Merge Mail with latest Rails and move mail gem to Gemfile.

  • Loading branch information...
2 parents fd58a2d + d92c4a8 commit 47e5caa96bffc04c8c0b287a975a609fb048e530 @josevalim josevalim committed Dec 27, 2009
Showing with 3,185 additions and 3,154 deletions.
  1. +12 −3 Gemfile
  2. +3 −13 actionmailer/lib/action_mailer.rb
  3. +14 −18 actionmailer/lib/action_mailer/adv_attr_accessor.rb
  4. +34 −62 actionmailer/lib/action_mailer/base.rb
  5. +2 −3 actionmailer/lib/action_mailer/delivery_method.rb
  6. +2 −2 actionmailer/lib/action_mailer/delivery_method/smtp.rb
  7. +8 −0 actionmailer/lib/action_mailer/deprecated_body.rb
  8. +5 −0 actionmailer/lib/action_mailer/mail_helper.rb
  9. +24 −0 actionmailer/lib/action_mailer/rails.rb
  10. +25 −7 actionmailer/test/adv_attr_test.rb
  11. +23 −14 actionmailer/test/mail_render_test.rb
  12. +5 −3 actionmailer/test/mail_service_test.rb
  13. +2 −2 actionmailer/test/url_test.rb
  14. +14 −0 actionpack/CHANGELOG
  15. +2 −2 actionpack/actionpack.gemspec
  16. +8 −10 actionpack/lib/abstract_controller.rb
  17. +5 −4 actionpack/lib/abstract_controller/base.rb
  18. +1 −1 actionpack/lib/abstract_controller/helpers.rb
  19. +1 −1 actionpack/lib/abstract_controller/layouts.rb
  20. +0 −28 actionpack/lib/abstract_controller/logger.rb
  21. +6 −8 actionpack/lib/abstract_controller/{rendering_controller.rb → rendering.rb}
  22. +57 −57 actionpack/lib/action_controller.rb
  23. +6 −72 actionpack/lib/action_controller/base.rb
  24. +7 −5 actionpack/lib/action_controller/caching.rb
  25. +7 −2 actionpack/lib/action_controller/metal.rb
  26. +0 −1 actionpack/lib/action_controller/metal/benchmarking.rb
  27. +1 −1 actionpack/lib/action_controller/metal/conditional_get.rb
  28. +131 −39 actionpack/lib/action_controller/metal/cookies.rb
  29. +40 −1 actionpack/lib/action_controller/metal/flash.rb
  30. +6 −1 actionpack/lib/action_controller/metal/head.rb
  31. +1 −1 actionpack/lib/action_controller/metal/layouts.rb
  32. +34 −0 actionpack/lib/action_controller/metal/logger.rb
  33. +9 −1 actionpack/lib/action_controller/metal/{rack_convenience.rb → rack_delegation.rb}
  34. +90 −0 actionpack/lib/action_controller/metal/redirecting.rb
  35. +0 −22 actionpack/lib/action_controller/metal/redirector.rb
  36. +3 −4 actionpack/lib/action_controller/metal/{render_options.rb → renderers.rb}
  37. +2 −2 actionpack/lib/action_controller/metal/{rendering_controller.rb → rendering.rb}
  38. +16 −16 actionpack/lib/action_controller/metal/request_forgery_protection.rb
  39. +0 −15 actionpack/lib/action_controller/metal/session.rb
  40. +1 −1 actionpack/lib/action_controller/metal/streaming.rb
  41. +1 −1 actionpack/lib/action_controller/metal/testing.rb
  42. +1 −1 actionpack/lib/action_controller/metal/url_for.rb
  43. +35 −35 actionpack/lib/action_controller/metal/verification.rb
  44. +0 −10 actionpack/lib/action_controller/notifications.rb
  45. +102 −0 actionpack/lib/action_controller/rails.rb
  46. +14 −12 actionpack/lib/action_controller/vendor/html-scanner.rb
  47. +27 −32 actionpack/lib/action_dispatch.rb
  48. +10 −1 actionpack/lib/action_dispatch/http/request.rb
  49. +14 −15 actionpack/lib/action_dispatch/http/response.rb
  50. +0 −25 actionpack/lib/action_dispatch/http/status_codes.rb
  51. +0 −20 actionpack/lib/action_dispatch/http/utils.rb
  52. +29 −0 actionpack/lib/action_dispatch/middleware/cascade.rb
  53. +23 −24 actionpack/lib/action_dispatch/middleware/params_parser.rb
  54. +1 −0 actionpack/lib/action_dispatch/middleware/session/abstract_store.rb
  55. +5 −4 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
  56. +3 −2 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
  57. +135 −78 actionpack/lib/action_dispatch/routing/mapper.rb
  58. +4 −4 actionpack/lib/action_dispatch/routing/route_set.rb
  59. +3 −1 actionpack/lib/action_dispatch/testing/assertions/dom.rb
  60. +1 −1 actionpack/lib/action_dispatch/testing/assertions/response.rb
  61. +12 −10 actionpack/lib/action_dispatch/testing/assertions/selector.rb
  62. +2 −0 actionpack/lib/action_dispatch/testing/assertions/tag.rb
  63. +2 −2 actionpack/lib/action_dispatch/testing/integration.rb
  64. +22 −21 actionpack/lib/action_view.rb
  65. +1 −0 actionpack/lib/action_view/helpers/sanitize_helper.rb
  66. +1 −1 actionpack/lib/action_view/helpers/translation_helper.rb
  67. +9 −13 actionpack/lib/action_view/render/rendering.rb
  68. +0 −1 actionpack/lib/action_view/safe_buffer.rb
  69. +8 −21 actionpack/lib/action_view/template.rb
  70. +2 −1 actionpack/lib/action_view/template/handlers/erb.rb
  71. +1 −1 actionpack/test/abstract/abstract_controller_test.rb
  72. +1 −1 actionpack/test/abstract/helper_test.rb
  73. +1 −1 actionpack/test/abstract/layouts_test.rb
  74. +1 −1 actionpack/test/abstract/localized_cache_test.rb
  75. +1 −1 actionpack/test/abstract/render_test.rb
  76. +35 −0 actionpack/test/controller/cookie_test.rb
  77. +36 −9 actionpack/test/controller/flash_test.rb
  78. +2 −2 actionpack/test/controller/render_test.rb
  79. +113 −8 actionpack/test/dispatch/response_test.rb
  80. +63 −3 actionpack/test/dispatch/routing_test.rb
  81. +1 −1 actionpack/test/dispatch/test_request_test.rb
  82. +2 −2 actionpack/test/template/translation_helper_test.rb
  83. +1 −0 activemodel/lib/active_model/validations.rb
  84. +56 −0 activerecord/CHANGELOG
  85. +64 −52 activerecord/lib/active_record.rb
  86. +5 −5 activerecord/lib/active_record/associations.rb
  87. +17 −2 activerecord/lib/active_record/associations/association_collection.rb
  88. +1 −1 activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  89. +1 −1 activerecord/lib/active_record/associations/has_many_association.rb
  90. +2 −2 activerecord/lib/active_record/autosave_association.rb
  91. +34 −122 activerecord/lib/active_record/base.rb
  92. +1 −1 activerecord/lib/active_record/calculations.rb
  93. +27 −11 activerecord/lib/active_record/named_scope.rb
  94. +0 −5 activerecord/lib/active_record/notifications.rb
  95. +59 −0 activerecord/lib/active_record/rails.rb
  96. +189 −64 activerecord/lib/active_record/relation.rb
  97. +4 −4 activerecord/test/cases/associations/has_many_through_associations_test.rb
  98. +7 −1 activerecord/test/cases/base_test.rb
  99. +1 −1 activerecord/test/cases/batches_test.rb
  100. +1 −1 activerecord/test/cases/dirty_test.rb
  101. +3 −56 activerecord/test/cases/finder_test.rb
  102. +2 −2 activerecord/test/cases/named_scope_test.rb
  103. +191 −40 activerecord/test/cases/relations_test.rb
  104. +2 −1 activeresource/lib/active_resource.rb
  105. +141 −2 activeresource/lib/active_resource/base.rb
  106. +55 −0 activeresource/lib/active_resource/schema.rb
  107. +420 −0 activeresource/test/cases/base/schema_test.rb
  108. +28 −25 activesupport/lib/active_support.rb
  109. +1 −0 activesupport/lib/active_support/core_ext/date/calculations.rb
  110. +1 −0 activesupport/lib/active_support/core_ext/date/conversions.rb
  111. +7 −22 activesupport/lib/active_support/core_ext/string/output_safety.rb
  112. +1 −0 activesupport/lib/active_support/core_ext/time/calculations.rb
  113. +5 −5 activesupport/lib/active_support/dependencies/autoload.rb
  114. +11 −2 activesupport/lib/active_support/json/encoding.rb
  115. +1 −0 activesupport/lib/active_support/ruby/shim.rb
  116. +1 −1 activesupport/lib/active_support/vendor.rb
  117. +0 −20 activesupport/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE
  118. +0 −20 activesupport/lib/active_support/vendor/i18n-0.1.3/README.textile
  119. +0 −5 activesupport/lib/active_support/vendor/i18n-0.1.3/Rakefile
  120. +0 −27 activesupport/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec
  121. +0 −204 activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb
  122. +0 −215 activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb
  123. +0 −53 activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb
  124. +0 −5 activesupport/lib/active_support/vendor/i18n-0.1.3/test/all.rb
  125. +0 −99 activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb
  126. +0 −124 activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb
  127. +0 −1 activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.rb
  128. +0 −3 activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.yml
  129. +0 −567 activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
  130. +1 −4 activesupport/lib/active_support/whiny_nil.rb
  131. +3 −1 activesupport/test/json/encoding_test.rb
  132. +7 −6 activesupport/test/whiny_nil_test.rb
  133. +1 −1 ci/geminstaller.yml
  134. +18 −0 railties/CHANGELOG
  135. +5 −0 railties/Rakefile
  136. +3 −0 railties/builtin/routes.rb
  137. +9 −33 railties/lib/rails.rb
  138. +43 −224 railties/lib/rails/application.rb
  139. +4 −16 railties/lib/rails/commands/server.rb
  140. +18 −11 railties/lib/rails/configuration.rb
  141. +34 −0 railties/lib/rails/core.rb
  142. +1 −1 railties/lib/rails/generators/actions.rb
  143. +1 −1 railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb
  144. +4 −4 railties/lib/rails/generators/rails/app/app_generator.rb
  145. +3 −5 railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb
  146. +1 −1 railties/lib/rails/generators/rails/app/templates/config.ru
  147. +32 −30 railties/lib/rails/generators/rails/app/templates/config/application.rb
  148. +0 −17 railties/lib/rails/generators/rails/app/templates/config/environments/development.rb
  149. +19 −0 railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
  150. +0 −31 railties/lib/rails/generators/rails/app/templates/config/environments/production.rb
  151. +33 −0 railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
  152. +0 −27 railties/lib/rails/generators/rails/app/templates/config/environments/test.rb
  153. +29 −0 railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
  154. +7 −0 ...ies/lib/rails/generators/rails/app/templates/config/initializers/cookie_verification_secret.rb.tt
  155. +7 −9 railties/lib/rails/generators/rails/app/templates/config/routes.rb
  156. +1 −1 railties/lib/rails/generators/rails/app/templates/script/console.tt
  157. +1 −1 railties/lib/rails/generators/rails/app/templates/script/dbconsole.tt
  158. +4 −2 railties/lib/rails/generators/rails/app/templates/script/server.tt
  159. +2 −4 railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
  160. +9 −5 railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
  161. +1 −0 railties/lib/rails/initializable.rb
  162. +5 −3 railties/lib/rails/plugin.rb
  163. +2 −3 railties/lib/rails/test_help.rb
  164. +29 −20 railties/test/application/configuration_test.rb
  165. +16 −14 railties/test/application/generators_test.rb
  166. +69 −93 railties/test/application/initializer_test.rb
  167. +4 −4 railties/test/application/load_test.rb
  168. +32 −7 railties/test/application/routing_test.rb
  169. +10 −0 railties/test/initializable_test.rb
  170. +5 −6 railties/test/initializer/initialize_i18n_test.rb
  171. +4 −4 railties/test/initializer/path_test.rb
  172. +16 −1 railties/test/isolation/abstract_unit.rb
  173. +1 −2 railties/test/paths_test.rb
  174. +2 −2 railties/test/plugins/configuration_test.rb
  175. +18 −0 railties/test/plugins/framework_extension_test.rb
View
15 Gemfile
@@ -1,19 +1,26 @@
gem "rake", ">= 0.8.7"
gem "mocha", ">= 0.9.8"
-gem "rails", "3.0.pre", :vendored_at => "railties"
+gem "rails", "3.0.pre", :path => "railties"
%w(activesupport activemodel actionpack actionmailer activerecord activeresource).each do |lib|
- gem lib, '3.0.pre', :vendored_at => lib
+ gem lib, '3.0.pre', :path => lib
end
+# AS
+gem "i18n", ">= 0.3.0"
+
+# AM
+gem "mail", ">= 1.4.1"
+
# AR
gem "arel", "0.2.pre", :git => "git://github.com/rails/arel.git"
gem "sqlite3-ruby", ">= 1.2.5"
gem "pg", ">= 0.8.0"
gem "mysql", ">= 2.8.1"
# AP
-gem "rack", "1.0.1", :git => "git://github.com/rails/rack.git"
+gem "rack", "1.1.0", :git => "git://github.com/rack/rack.git"
+gem "rack-test", "0.5.3"
gem "RedCloth", ">= 4.2.2"
if ENV['CI']
@@ -30,3 +37,5 @@ if ENV['CI']
gem "test-unit", ">= 2.0.5"
end
end
+
+disable_system_gems
@@ -31,15 +31,13 @@ module ActionMailer
extend ::ActiveSupport::Autoload
autoload :AdvAttrAccessor
- autoload :DeprecatedBody
autoload :Base
autoload :DeliveryMethod
+ autoload :DeprecatedBody
autoload :MailHelper
- autoload :Part
- autoload :PartContainer
autoload :Quoting
+ autoload :TestCase
autoload :TestHelper
-
end
module Text
@@ -48,12 +46,4 @@ module Text
autoload :Format, 'action_mailer/vendor/text_format'
end
-module Net
- extend ActiveSupport::Autoload
-
- autoload :SMTP
-end
-
-
-gem 'mail', '>= 1.4.1'
-require 'mail'
+require 'mail'
@@ -1,29 +1,25 @@
module ActionMailer
module AdvAttrAccessor #:nodoc:
- def self.included(base)
- base.extend(ClassMethods)
- end
-
- module ClassMethods #:nodoc:
- def adv_attr_accessor(*names)
- names.each do |name|
- ivar = "@#{name}"
+ def adv_attr_accessor(*names)
+ names.each do |name|
+ ivar = "@#{name}"
- define_method("#{name}=") do |value|
- instance_variable_set(ivar, value)
+ class_eval <<-ACCESSORS, __FILE__, __LINE__ + 1
+ def #{name}=(value)
+ #{ivar} = value
end
- define_method(name) do |*parameters|
- raise ArgumentError, "expected 0 or 1 parameters" unless parameters.length <= 1
- if parameters.empty?
- if instance_variable_names.include?(ivar)
- instance_variable_get(ivar)
- end
+ def #{name}(*args)
+ raise ArgumentError, "expected 0 or 1 parameters" unless args.length <= 1
+ if args.empty?
+ #{ivar} if instance_variable_names.include?(#{ivar.inspect})
else
- instance_variable_set(ivar, parameters.first)
+ #{ivar} = args.first
end
end
- end
+ ACCESSORS
+
+ self.protected_instance_variables << ivar if self.respond_to?(:protected_instance_variables)
end
end
end
@@ -3,7 +3,6 @@
module ActionMailer #:nodoc:
# Action Mailer allows you to send email from your application using a mailer model and views.
#
- #
# = Mailer Models
#
# To use Action Mailer, you need to create a mailer model.
@@ -22,7 +21,8 @@ module ActionMailer #:nodoc:
# bcc ["bcc@example.com", "Order Watcher <watcher@example.com>"]
# from "system@example.com"
# subject "New account information"
- # body :account => recipient
+ #
+ # @account = recipient
# end
# end
#
@@ -42,13 +42,6 @@ module ActionMailer #:nodoc:
# address. Setting this is useful when you want delivery notifications sent to a different address than
# the one in <tt>from</tt>.
#
- # The <tt>body</tt> method has special behavior. It takes a hash which generates an instance variable
- # named after each key in the hash containing the value that that key points to.
- #
- # So, for example, <tt>body :account => recipient</tt> would result
- # in an instance variable <tt>@account</tt> with the value of <tt>recipient</tt> being accessible in the
- # view.
- #
#
# = Mailer views
#
@@ -68,7 +61,12 @@ module ActionMailer #:nodoc:
# You can even use Action Pack helpers in these views. For example:
#
# You got a new note!
- # <%= truncate(note.body, 25) %>
+ # <%= truncate(@note.body, 25) %>
+ #
+ # If you need to access the subject, from or the recipients in the view, you can do that through mailer object:
+ #
+ # You got a new note from <%= mailer.from %>!
+ # <%= truncate(@note.body, 25) %>
#
#
# = Generating URLs
@@ -250,29 +248,22 @@ module ActionMailer #:nodoc:
# <tt>["text/html", "text/enriched", "text/plain"]</tt>. Items that appear first in the array have higher priority in the mail client
# and appear last in the mime encoded message. You can also pick a different order from inside a method with
# +implicit_parts_order+.
- class Base
- include AdvAttrAccessor, Quoting
+ class Base < AbstractController::Base
+ include Quoting
+ extend AdvAttrAccessor
- include AbstractController::RenderingController
+ include AbstractController::Rendering
include AbstractController::LocalizedCache
include AbstractController::Layouts
-
include AbstractController::Helpers
- helper ActionMailer::MailHelper
-
- if Object.const_defined?(:ActionController)
- include ActionController::UrlWriter
- end
+ helper ActionMailer::MailHelper
+
+ include ActionController::UrlWriter
include ActionMailer::DeprecatedBody
private_class_method :new #:nodoc:
- class_inheritable_accessor :view_paths
- self.view_paths = []
-
- cattr_accessor :logger
-
@@raise_delivery_errors = true
cattr_accessor :raise_delivery_errors
@@ -294,7 +285,7 @@ class Base
@@default_implicit_parts_order = [ "text/html", "text/enriched", "text/plain" ]
cattr_accessor :default_implicit_parts_order
- @@protected_instance_variables = []
+ @@protected_instance_variables = %w(@parts @mail)
cattr_reader :protected_instance_variables
# Specify the BCC addresses for the message
@@ -344,24 +335,13 @@ class Base
# have multiple mailer methods share the same template.
adv_attr_accessor :template
- # The mail and action_name instances referenced by this mailer.
- attr_reader :mail, :action_name
-
- # Where the response body is stored.
- attr_internal :response_body
-
# Override the mailer name, which defaults to an inflected version of the
# mailer's class name. If you want to use a template in a non-standard
# location, you can use this to specify that location.
- attr_writer :mailer_name
+ adv_attr_accessor :mailer_name
- def mailer_name(value = nil)
- if value
- @mailer_name = value
- else
- @mailer_name || self.class.mailer_name
- end
- end
+ # Expose the internal mail
+ attr_reader :mail
# Alias controller_path to mailer_name so render :partial in views work.
alias :controller_path :mailer_name
@@ -384,14 +364,12 @@ def part(params)
# Add an attachment to a multipart message. This is simply a part with the
# content-disposition set to "attachment".
def attachment(params, &block)
+ super # Run deprecation hooks
+
params = { :content_type => params } if String === params
params = { :content_disposition => "attachment",
:content_transfer_encoding => "base64" }.merge(params)
- 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
+
part(params, &block)
end
@@ -479,17 +457,16 @@ def matches_dynamic_method?(method_name) #:nodoc:
# will be initialized according to the named method. If not, the mailer will
# remain uninitialized (useful when you only need to invoke the "receive"
# method, for instance).
- def initialize(method_name=nil, *parameters) #:nodoc:
- @_response_body = nil
+ def initialize(method_name=nil, *args) #:nodoc:
super()
- create!(method_name, *parameters) if method_name
+ process(method_name, *args) if method_name
end
- # Initialize the mailer via the given +method_name+. The body will be
- # rendered and a new Mail object created.
- def create!(method_name, *parameters) #:nodoc:
+ # Process the mailer via the given +method_name+. The body will be
+ # rendered and a new TMail::Mail object created.
+ def process(method_name, *args) #:nodoc:
initialize_defaults(method_name)
- __send__(method_name, *parameters)
+ super
# Create e-mail parts
create_parts
@@ -498,8 +475,8 @@ def create!(method_name, *parameters) #:nodoc:
@subject ||= I18n.t(:subject, :scope => [:actionmailer, mailer_name, method_name],
:default => method_name.humanize)
- # build the mail object itself
- @mail = create_mail
+ # Build the mail object itself
+ create_mail
end
# Delivers a Mail object. By default, it delivers the cached mail
@@ -513,7 +490,7 @@ def deliver!(mail = @mail)
logger.debug "\n#{mail.encoded}"
end
- ActiveSupport::Notifications.instrument(:deliver_mail, :mail => @mail) do
+ ActiveSupport::Notifications.instrument(:deliver_mail, :mail => mail) do
begin
self.delivery_method.perform_delivery(mail) if perform_deliveries
rescue Exception => e # Net::SMTP errors or sendmail pipe errors
@@ -535,23 +512,18 @@ def initialize_defaults(method_name)
@implicit_parts_order ||= @@default_implicit_parts_order.dup
@mime_version ||= @@default_mime_version.dup if @@default_mime_version
- @mailer_name ||= self.class.mailer_name
+ @mailer_name ||= self.class.mailer_name.dup
@template ||= method_name
- @action_name = @template
@parts ||= []
@headers ||= {}
@sent_on ||= Time.now
- ActiveSupport::Deprecation.silence do
- super # Run deprecation hooks
- end
+ super # Run deprecation hooks
end
def create_parts
- ActiveSupport::Deprecation.silence do
- super # Run deprecation hooks
- end
+ super # Run deprecation hooks
if String === response_body
@parts.unshift Mail::Part.new(
@@ -1,7 +1,7 @@
-require "active_support/core_ext/class"
+require 'active_support/core_ext/class'
+
module ActionMailer
module DeliveryMethod
-
autoload :File, 'action_mailer/delivery_method/file'
autoload :Sendmail, 'action_mailer/delivery_method/sendmail'
autoload :Smtp, 'action_mailer/delivery_method/smtp'
@@ -52,6 +52,5 @@ class Method
superclass_delegating_accessor :settings
self.settings = {}
end
-
end
end
@@ -1,8 +1,9 @@
+require 'net/smtp'
+
module ActionMailer
module DeliveryMethod
# A delivery method implementation which sends via smtp.
class Smtp < Method
-
self.settings = {
:address => "localhost",
:port => 25,
@@ -25,6 +26,5 @@ def perform_delivery(mail)
end
end
end
-
end
end
@@ -15,6 +15,14 @@ def initialize_defaults(method_name)
@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 ' <<
@@ -15,5 +15,10 @@ def block_format(text)
formatted
end
+
+ # Access the mailer instance.
+ def mailer #:nodoc:
+ @controller
+ end
end
end
Oops, something went wrong.

0 comments on commit 47e5caa

Please sign in to comment.