aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
Commit message (Collapse)AuthorAgeFilesLines
* Clear mail after testyuuji.yaginuma2017-08-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | If clear it before the test, the mail of the last executed test will not be correctly cleared. Therefore, executing the test with seed below will result in an error. ``` ./bin/test -w --seed 55480 Run options: --seed 55480 # Running: ...........................................................................................................................................................F Failure: MailDeliveryTest#test_does_not_increment_the_deliveries_collection_on_error [/home/yaginuma/program/rails/master_y_yagi/rails/actionmailer/test/delivery_methods_test.rb:221]: --- expected +++ actual @@ -1 +1 @@ -[] +[#<Mail::Message:47011389364640, Multipart: false, Headers: <Date: Mon, 14 Aug 2017 07:48:40 +0900>, <From: test-sender@test.com>, <To: test-receiver@test.com>, <Message-ID: <5990d748ea5b2_29342ac1af8bcf40886f7@yaginuma.mail>>, <Subject: Test Subject>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>>] bin/test test/delivery_methods_test.rb:216 ```
* Merge pull request #29559 from kirs/eager-load-controller-actionsRafael França2017-08-111-0/+6
|\ | | | | Eager load controller actions to reduce response time of the first request
| * Eager load controller and mailer actionsKir Shatrov2017-07-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | On the first request, ActionController::Base#action_methods computes and memoized the list of available actions [1]. With this PR we move this expensive operation into eager load step to reduce response time of the first request served in production. This also reduces the memory footprint when running on forking server like Unicorn. [1] https://github.com/rails/rails/blob/a3813dce9a0c950a4af7909111fa730a2622b1db/actionpack/lib/abstract_controller/base.rb#L66-L77
* | Remove outdated comment [ci skip]Youssef Boulkaid2017-08-061-4/+0
| | | | | | | | | | The comment was describing a previous version of the method with a different signature. This is outdated since e76c38e
* | Merge remote-tracking branch 'origin/master' into unlock-minitestRafael Mendonça França2017-08-0142-0/+83
|\|
| * Use frozen string literal in actionmailer/Kir Shatrov2017-07-2342-0/+83
| |
* | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-07-1510-18/+59
|\|
| * Merge branch 'master' into require_relative_2017Xavier Noria2017-07-021-2/+2
| |\
| | * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0242-42/+0
| | | | | | | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| | * Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-0242-0/+42
| | |\ | | | | | | | | | | | | Enforce frozen string in Rubocop
| | | * Enforce frozen string in RubocopKir Shatrov2017-07-0142-0/+42
| | | |
| | * | Merge pull request #29506 from pat/frozen-string-literalsMatthew Draper2017-07-021-2/+2
| | |\ \ | | | |/ | | |/| | | | | Make ActiveSupport frozen-string-literal friendly.
| | | * Make ActionMailer frozen string literal friendly.Pat Allan2017-06-201-2/+2
| | | |
| * | | [Action Mailer] require => require_relativeAkira Matsuda2017-07-012-4/+4
| |/ /
| * / Add source code and changelog links to gemspecsGrey Baker2017-06-281-0/+5
| |/
| * Fix formatting of `ActionMailer::MessageDelivery` doc [ci skip]Ryuta Kamizono2017-06-161-4/+4
| |
| * Document setting the delivery_job for ActionMailer [ci skip]Matthew Mongeau2017-06-161-0/+16
| |
| * Fix indentation [ci skip]Ryuta Kamizono2017-06-151-6/+7
| |
| * Allow mailers to configure their delivery jobMatthew Mongeau2017-06-154-1/+26
| | | | | | | | | | | | | | | | | | | | | | Setting delivery_job on a mailer class will cause MessageDelivery to use the specified job instead of ActionMailer::DeliveryJob: class MyMailer < ApplicationMailer self.delivery_job = MyCustomDeliveryJob ... end
| * Use `require_relative` instead of `require` with full pathbogdanvlviv2017-06-141-1/+1
| |
| * Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-032-10/+4
| |
* | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-05-298-20/+14
|\|
| * Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
| * Define path with __dir__bogdanvlviv2017-05-235-6/+6
| | | | | | | | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
| * Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-7/+3
| |
| * Should escape meta characters in regexpRyuta Kamizono2017-05-071-1/+1
| |
| * Merge pull request #28835 from fphilipe/masterRafael França2017-05-021-0/+1
| |\ | | | | | | Add missing require in ActionMailer::Base
| | * Add missing require in ActionMailerPhilipe Fatio2017-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, Action Mailer doesn't work like it used to on version 4. The following snippet fails since version 5: > require 'action_mailer' > ActionMailer::Base NameError: uninitialized constant ActiveSupport::Rescuable
* | | Avoid stubing on this testRafael Mendonça França2017-04-271-3/+2
|/ / | | | | | | | | This will avoid to the test fail when running in isolation because the message generated is nil.
* | Merge pull request #28244 from ixti/improve/action-mailer-preview-paramsRafael França2017-04-262-2/+24
|\ \ | |/ |/| Pass request params to ActionMailer::Preview
| * Pass request params to ActionMailer::PreviewAlexey Zapparov2017-03-012-2/+24
| |
* | Remove duplicated `delivery_method` definitionyuuji.yaginuma2017-04-071-1/+0
| | | | | | | | | | `ActionMailer::Base.delivery_method` is already defined in https://github.com/rails/rails/blob/master/actionmailer/test/parameterized_test.rb#L13
* | Start Rails 5.2 developmentMatthew Draper2017-03-222-35/+3
| |
* | Use better duration aliases in testsAndrew White2017-03-151-2/+2
| |
* | Don't cast to float unnecessarilyAndrew White2017-03-151-2/+2
| | | | | | | | Adding durations to `Time` instances is perfectly okay.
* | Document using `default_url_options` in an ActionMailer class.Krzysztof Zych2017-03-081-0/+3
| |
* | Deprecate implicit coercion of `ActiveSupport::Duration`Andrew White2017-03-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `ActiveSupport::Duration` implicitly converts to a seconds value when used in a calculation except for the explicit examples of addition and subtraction where the duration is the receiver, e.g: >> 2 * 1.day => 172800 This results in lots of confusion especially when using durations with dates because adding/subtracting a value from a date treats integers as a day and not a second, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 2 * 1.day => Mon, 10 Apr 2490 To fix this we're implementing `coerce` so that we can provide a deprecation warning with the intent of removing the implicit coercion in Rails 5.2, e.g: >> 2 * 1.day DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2. => 172800 In Rails 5.2 it will raise `TypeError`, e.g: >> 2 * 1.day TypeError: ActiveSupport::Duration can't be coerced into Integer This is the same behavior as with other types in Ruby, e.g: >> 2 * "foo" TypeError: String can't be coerced into Integer >> "foo" * 2 => "foofoo" As part of this deprecation add `*` and `/` methods to `AS::Duration` so that calculations that keep the duration as the receiver work correctly whether the final receiver is a `Date` or `Time`, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 1.day * 2 => Fri, 03 Mar 2017 Fixes #27457.
* Preparing for 5.1.0.beta1 releaseRafael Mendonça França2017-02-232-1/+3
|
* Add backticks around constantJon Moss2017-02-211-1/+1
| | | | [ci skip]
* Freeze fragment cache related instrument name.Stan Lo2017-02-071-1/+1
| | | | | | | | | | | | | ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
* Add `:args` to `process.action_mailer` eventyuuji.yaginuma2017-02-043-1/+25
|
* Don't mutate raw_source in mailer preview interceptorEugene Kenny2017-01-301-5/+1
| | | | | | | | The raw_source method is documented as returning the exact value that was used to create the body; mutating it breaks that contract. Additionally, if the value used to create the body is blank, raw_source returns a frozen string which causes the interceptor to raise an error.
* add default value to `deliver_later_queue_name` option [ci skip]yuuji.yaginuma2017-01-311-1/+1
|
* Document with with an example an link to ParameterizedRafael Mendonça França2017-01-301-1/+6
| | | | | Also change the class_methods to ClassMethods since the former document the method as an instance method of Parameterized not as a class method.
* :scissors:Rafael Mendonça França2017-01-301-1/+1
|
* No need to advertise in the rdoc documentationRafael Mendonça França2017-01-301-3/+0
|
* Avoid should in test namesRafael Mendonça França2017-01-301-1/+1
|
* Implement respond_to_missing? in the Parameterized::Mailer classRafael Mendonça França2017-01-302-6/+25
|
* Remove unneeded nodocRafael Mendonça França2017-01-301-1/+1
|
* Override the initializers instead of using tapRafael Mendonça França2017-01-301-3/+6
| | | | We own the class so we can override the initialize.