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

Andy Allan notifications at github.com
Thu Oct 16 08:57:44 UTC 2025


@gravitystorm commented on this pull request.



> +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(...)
+    preview = nil
+    ActiveRecord::Base.transaction do
+      preview = super(...)
+      raise ActiveRecord::Rollback
+    end
+    preview
+  end
+
+  def diary_comment_notification
+    recipient = create(:user)

Oh that's awesome, thanks for that!

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

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


More information about the rails-dev mailing list