[openstreetmap/openstreetmap-website] Enable ActionMailer Previews (PR #6449)

Pablo Brasero notifications at github.com
Thu Oct 16 09:06:55 UTC 2025


@pablobm approved this pull request.

This is really clever, in the good sense 👍

> @@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require "factory_bot_rails"
+
+class UserMailerPreview < ActionMailer::Preview
+  include FactoryBot::Syntax::Methods
+
+  # Wraps the preview in a transaction, so that no changes
+  # are persisted to the development db
+  def self.call(...)

6 years after being made available in the language, TIL about argument forwarding with `...` 😳 I have always used `*` and variants, but this seems easier.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6449#pullrequestreview-3343781227
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6449/review/3343781227 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251016/cfbf8cf1/attachment.htm>


More information about the rails-dev mailing list