Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Looking at ways to improve the Gem and fix support for Rails > 7.0.8 Overriding the Rails::MailerController is a recipie for pain and is the source of the issue we see in Rails > 7.0.8. Right now I think all this does is allows a custom layout (the GOV.UK one) - we can do that without the heavy handiness by suppling a layout in the Mailer class - this commit contains that change. To support the layout simply being in the views, we have to become a 'Engine' so we can add views by replicating the Rails directories (there are other ways but this is nice and simple). Becuase engines are just Railties, everything should work as it did, again that change is here - needs better naming. https://api.rubyonrails.org/classes/Rails/Engine.html With all that done, the previews just work™ the mailer suppling the layout overide for Mail::Notify::Mailer subclasses only. I've only checked the 'view' version so far - but I can't see it being a problem for the 'template' version. With these changes all of the rails stuff in the specs is redundent, I think - so everything becomes much simpler. Right now I am testing this with a fully fledged Rails 7.1.2 install - it would be nice to come up with a way to run 'tests' in all 3 major versions of Rails - may Docker could help? I would like to get this working and go for 1.2.1 so testing outside of the repo is probably enough for now though! Until next Friday! :wave:
- Loading branch information