Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
fe3f92e
activejob: Copy hand-written RBS and test from 6.0 to 8.1
amatsuda Oct 13, 2026
e49adbb
activejob: Generate RBS from activejob 8.1.4
amatsuda Oct 13, 2026
f7a72d3
activejob: Remove fake types for the Que and Sucker Punch adapters
amatsuda Oct 13, 2026
d5e3099
activejob: Add logger and log_arguments to ActiveJob::Base
amatsuda Oct 13, 2026
976d951
activejob: Type return values of commonly used job methods
amatsuda Oct 13, 2026
a339243
activejob: Make blocks optional where calling without one is valid
amatsuda Oct 13, 2026
476eeb3
activejob: Extend Callbacks and Rescuable class methods in ActiveJob:…
amatsuda Oct 13, 2026
b68095d
actionmailer: Copy hand-written RBS and test from 7.0 to 8.1
amatsuda Oct 13, 2026
ddf4942
actionmailer: Generate RBS from actionmailer 8.1.4
amatsuda Oct 13, 2026
fa45791
actionmailer: Remove the fake Mail::Message
amatsuda Oct 13, 2026
1a3052f
actionmailer: Rename MessageDelivery#processed to processed?
amatsuda Oct 13, 2026
d436c62
actionmailer: Make blocks optional where calling without one is valid
amatsuda Oct 13, 2026
9fb0244
actionmailer: Add delivery_job and deliver_later_queue_name to Action…
amatsuda Oct 13, 2026
1d49320
actionmailer: Extend the class methods of the concerns ActionMailer::…
amatsuda Oct 13, 2026
ca585ae
actionmailer: Type return values of deliver_later, deliveries, and ca…
amatsuda Oct 13, 2026
e1deacb
actionmailer: Extend the class methods of the concerns ActionMailer::…
amatsuda Oct 13, 2026
36afc86
Merge branch 'main' into actionmailer-8.1
ksss Oct 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gems/actionmailer/8.1/_test/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
additional_gems:
- railties
83 changes: 83 additions & 0 deletions gems/actionmailer/8.1/_test/railsguides.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
module RailsGuides
class ApplicationMailer < ActionMailer::Base
default from: '[email protected]'
layout 'mailer'

before_deliver :log_delivery
rescue_from(ArgumentError) { |exception| exception.message }
self.raise_delivery_errors = true

private

def log_delivery
end
end

class NotifierMailer < ApplicationMailer
default from: '[email protected]',
return_path: '[email protected]'

def welcome(recipient)
@account = recipient
mail(to: recipient,
bcc: ["[email protected]", "Order Watcher <[email protected]>"])
end

# @dynamic self.welcome
end

class UserMailer < ApplicationMailer
default from: '[email protected]'

def welcome_email
@user = params[:user]
@url = 'http://example.com/login'
mail(to: "@user", subject: 'Welcome to My Awesome Site')
end
end

class I18nUserMailer < ActionMailer::Base
def welcome(email, username)
mail(to: email, subject: default_i18n_subject(user: username))
end
end

NotifierMailer.welcome("first user").deliver_now
NotifierMailer.welcome("first user").message
NotifierMailer.welcome("first user").deliver_later
end

delivery = RailsGuides::NotifierMailer.welcome("first user")
delivery.deliver_now unless delivery.processed?

class NotifierMailerTest < ActionMailer::TestCase
tests RailsGuides::NotifierMailer

def test_welcome
assert_no_emails
assert_no_enqueued_emails
RailsGuides::NotifierMailer.welcome("first user").deliver_later
assert_enqueued_emails 1
assert_enqueued_email_with RailsGuides::NotifierMailer, :welcome, args: ["first user"]
deliver_enqueued_emails
end
end

RailsGuides::ApplicationMailer.deliver_later_queue_name = :low
RailsGuides::ApplicationMailer.delivery_job = ActionMailer::MailDeliveryJob

if (job = RailsGuides::NotifierMailer.welcome("first user").deliver_later(wait: 1.hour))
job.job_id.upcase
end
if (job = RailsGuides::NotifierMailer.welcome("first user").deliver_later!)
job.job_id.upcase
end
ActionMailer::Base.deliveries.last&.subject
ActionMailer::Base.deliveries.clear

class NotifierMailerTest
def test_capture
emails = capture_emails { RailsGuides::NotifierMailer.welcome("first user").deliver_later }
emails.first&.to
end
end
34 changes: 34 additions & 0 deletions gems/actionmailer/8.1/_test/railsguides.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module RailsGuides
class ApplicationMailer < ActionMailer::Base
private

def log_delivery: () -> void
end

class NotifierMailer < ApplicationMailer
@account: untyped

def welcome: (untyped) -> Mail::Message

def self.welcome: (untyped) -> ActionMailer::MessageDelivery
end

class UserMailer < ApplicationMailer
@user: untyped
@url: String

def welcome_email: () -> Mail::Message
end

class I18nUserMailer < ApplicationMailer
def welcome: (String email, String username) -> Mail::Message
end
end

class NotifierMailerTest < ActionMailer::TestCase
def test_welcome: () -> void
end

class NotifierMailerTest
def test_capture: () -> void
end
4 changes: 4 additions & 0 deletions gems/actionmailer/8.1/_test/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Write Ruby code to test the RBS.
# It is type checked by `steep check` command.

require "actionmailer"
Loading
Loading