| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | | |
It also removes a monkey patch from AM::Base
|
|\ \ \
| | | |
| | | | |
Remove private def
|
| |/ / |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`.
```ruby
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "benchmark-ips"
end
Benchmark.ips do |x|
x.report('+@') { +"" }
x.report('dup') { "".dup }
x.compare!
end
```
```
$ ruby -v benchmark.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Warming up --------------------------------------
+@ 282.289k i/100ms
dup 187.638k i/100ms
Calculating -------------------------------------
+@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s
dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s
Comparison:
+@: 6775299.3 i/s
dup: 3320400.7 i/s - 2.04x slower
```
|
| |
| |
| |
| |
| |
| |
| | |
Since these changes related to the public API, I think we should add
changelog entries.
Related to #33838, #33849
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As @dhh brings up, the point of `ActionDispatch::IntegrationTest` is to
allow users to test the integration of all the pieces called by a
controller. Asserting about the emails and jobs queued is part of that
task.
This commit includes the `ActionMailer::TestHelper` and
`ActiveJob::TestHelper` modules when the ActionMailer and ActiveJob
railties are initialized respectively.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use attr_reader/attr_writer instead of methods
method is 12% slower
Use flat_map over map.flatten(1)
flatten is 66% slower
Use hash[]= instead of hash.merge! with single arguments
merge! is 166% slower
See https://github.com/rails/rails/pull/32337 for more conversation
|
| |
| |
| |
| | |
`assert_no_emails` is shortcut for `assert_emails 0, &block`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Example of `assert_enqueued_with` with no block
```ruby
def test_assert_enqueued_with
MyJob.perform_later(1,2,3)
assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low')
MyJob.set(wait_until: Date.tomorrow.noon).perform_later
assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon)
end
```
Example of `assert_enqueued_email_with` with no block:
```ruby
def test_email
ContactMailer.welcome.deliver_later
assert_enqueued_email_with ContactMailer, :welcome
end
def test_email_with_arguments
ContactMailer.welcome("Hello", "Goodbye").deliver_later
assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"]
end
```
Related to #33243
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* ActionMailer::Base can unregister observer(s) and interceptor(s).
One or multiple mail observers can be unregistered using
`ActionMailer::Base.unregister_observers` or
`ActionMailer::Base.unregister_observer`.
One or multiple mail interceptors can be unregistered using
`ActionMailer::Base.unregister_interceptors` or
`ActionMailer::Base.unregister_interceptor`.
For preview interceptors, it's possible to use
`ActionMailer::Base.unregister_preview_interceptors` or
`ActionMailer::Base.unregister_preview_interceptor`.
* Ensure to be reset registered observer(s) and interceptor(s)
* Add explanation to CHANGELOG
* Add original author's name
[Kota Miyake + Rafael Mendonça França + Claudio Ortolina]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Eager autoload mail gem when eager load is true
We had a production issue where our Sidekiq worker threads all became
deadlocked while autoloading a file within the mail gem, required via
ActionMailer, despite setting our Rails applicaiton to eager load.
`Mail.eager_autoload!` exists and works great, ActionMailer just doesn't
call it during eager loading. Adding it to the ActionMailer Railtie's
eager_load_namespaces takes care of calling `Mail.eager_autoload!`
during the `eager_load!` initializer.
* 'Mail' isn't defined yet, use before_eager_load instead
* Make sure mail is loaded
* Move eager load of Mail into ActionMailer.eager_load!
[Samuel Cochran + Rafael Mendonça França]
|
| |
| |
| |
| | |
In the previous code incorrectly removes intermediate words.
|
| |
| |
| |
| |
| | |
This autocorrects the violations after adding a custom cop in
3305c78dcd.
|
|\ \
| | |
| | |
| | |
| | | |
Small doc fixes
[ci skip]
|
| | |
| | |
| | |
| | | |
[ci skip]
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| | |
- Remove extra execution of `perform_enqueued_jobs`
since it performs all enqueued jobs in the duration of the block.
- Fix example of using `assert_emails` without block since we
can't use enqueued jobs in this case.
|
|\ \
| | |
| | |
| | | |
Perform email jobs in #assert_emails
|
|/ /
| |
| |
| | |
Perform enqueued delivery jobs in #assert_emails and #assert_no_emails.
|
| |
| |
| |
| |
| |
| | |
Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug.
References #32028
|
| |
| |
| |
| | |
Rails 6 will only support Ruby >= 2.3.
|
| |
| |
| |
| | |
:tada::tada::tada:
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | | |
Fix actionmailer lambda default
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
PR #29270 changed the number of arguments that gets passed to Procs
defined in ActionMail::Base.default. With this changeset, Procs can
now have 1 or 0 arguments
Also adds test coverage for AM::Base.default Proc arity.
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | | |
- And move the Active Job related section down. Otherwise it was
appearing as if the options are available for the `delivery_job`
setting.
|
| | | |
|
| | |
| | |
| | |
| | | |
Follow up of #31390.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make clear that the files are not to be run for interpreters.
Fixes #23847.
Fixes #30690.
Closes #23878.
|
| | |
| | |
| | |
| | |
| | | |
Reverts 4d96be1c27bd6faed957b197a461f18543acebf2
References #31026
|
|\ \ \
| | | |
| | | | |
Remove redundant return statements
|
| | | | |
|
|/ / / |
|
| | |
| | |
| | |
| | | |
This basically reverts cd9cc721ab54e2b0c7875cacf2113f03908a8bb7
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Add missing credit
* Add backticks
* Fix indentation
* Remove trailing spaces
And some minor tweaks.
|
| | | |
|
|/ / |
|
| | |
|
|\ \
| | |
| | |
| | | |
Do not generate default alt text for images
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Auto-generating content from the filename of an image is not suitable
alternative text; alt text that isn't fully considered can be
distracting and fatiguing for screen readers users (blind, low vision,
dyslexic people).
- Setting a filename fallback short circuits screen reader default
behavior and configuration for blank descriptions.
- Setting poor defaults also creates false negatives for accessibility
linting and testing software, that makes it harder to improve
application accessibility.
***
- After this change, if authors leave images without alt text, screen
readers will fallback to default behavior for missing alt text.
- Also with this change, Automated linting and testing tools will
correctly generate warnings.
[Fixes #30096]
|