The various LogSubscriber subclasses tend to subscribe to events
but then end up doing nothing if the log level is high enough.
But even if we end up not logging, we have to go through the
entire notification path, record timing etc.
By allowing subscribers to dynamically bail out early, we can
save a lot of work if all subscribers are silenced.
* This is an attempt to make the assert_enqueued_email_with easier to implement.
* Update actionmailer/test/test_helper_test.rb
Fix spelling.
* Documenting additional tests
* Missing a closing "end"
* Renaming tests for consistency
* Updating name
* Naming and documentation
* Leaving original test unchanged
* Fix test name, add new test
* Add assert_enqueued_emails examples to Rails guide
* Add example to test_helper
* Tweaking the Rails guide (#3)
* Updating Rails guide for consistency.
Co-authored-by: Bry <bryan.hunt@hey.com>
Co-authored-by: Ron Shinall <81988008+ron-shinall@users.noreply.github.com>
Right now many helpers have to deal with two modes of operation to
capture view output.
The main one is to swap the `@output_buffer` variable with a new buffer.
But since some view implementations such as `builder` keep a reference
on the buffer they were initialized with, this doesn't always work.
So additionally, the various capturing helpers also record the buffer
length prior to executing the block, and then `slice!` the buffer back
to its original size.
This is wasteful and make the code rather unclear.
Now that `OutputBuffer` is a delegator, I'd like to refactor all this
so that:
- @output_buffer is no longer re-assigned
- A single OutputBuffer instance is used for the entire response rendering
- Instead capturing is done through `OutputBuffer#capture`
Once the above is achieved, it should allow us to enabled Erubi's
`:chain_appends` option and get some reduced template size and some
performance.
Not re-assigning `@output_buffer` will also allow template to access
the local variable instead of an instance variable, which is cheaper.
But more importantly, that should make the code easier to understand
and easier to be compatible with `StreamingBuffer`.
These classes are relatively small, however they include lots of
modules as helpers. And if any of the included module hold constants
including it cause the global constant cache to be invalidated
which is really bad for performance.
So when eager loading is enabled we create all the possible classes
as part of the application boot.
RDoc will automatically format and link API references as long as they
are not already marked up as inline code.
This commit removes markup from various API references so that those
references will link to the relevant API docs.
In Ruby 3.1 those gems were dropped from the stdlib, so they need to be
explicitly installed. Mail should be doing this for us, but since it
cares about Ruby < 2.6, and those gems can't be installed there, they
can't add them to the gemspec without dropping support to old rubies.
Since we don't care about Ruby < 2.7, we can just require them in all
frameworks that use mail.
The word "Crazy" has long been associated with mental illness. While
there may be other dictionary definitions, it's difficult for some of us
to separate the word from the stigmatization, gaslighting, and bullying
that often comes along with it.
This commit replaces instances of the word with various alternatives. I
find most of these more focused and descriptive than what we had before.
The default is set to 5 and only applied for new applications or
applications that opt-in for this new default.
Closes#42089.
[André Luis Leal Cardoso Junior + Rafael Mendonça França]
The default queue name used by `deliver_later` is no longer `mailers`.
This commit removes the misleading information from the class
documentation
Ref: #40848