I introduced a NullMail class. When mail() is never called an instance of NullMail is returned in place of a regular Mail.
This refactoring fixes #7761
I created a very small class called NullMail. What is the best practice in the rails codebase for tiny classes. Do you embed those in side the class that uses them or do you put them in a new file?
Also my BlankSlate implementation is very basic. Do you use a different pattern in the rails source?
@KieranP @jeremy @rafaelfranca What do you think?
Could you please add a # :nodoc: directive here?
Could we leave this initialization here? Without it we can receive a "non-initialized instance variable" warning
yes I'll move it there. I put it in process because I think it communicates the intent better, than overwriting the variable later. If it produces warnings though I'll put it back.
I would put NullMail inside of ActionMailer::Base
Do not render views when mail() isn't called. (NullMail refactoring)
@rafaelfranca moved NullMail. Can you check again?
Seems good to me. Thank you