Skip to content

Commit a431853

Browse files
committed
fix actionmailer concern type errors with RBI
1 parent 553d36a commit a431853

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

lib/rails_structured_logging/action_mailer/error_handling.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ module ErrorHandling
1515
extend ActiveSupport::Concern
1616

1717
included do
18-
# Tell Sorbet that 'self' in this context has rescue_from available
19-
# This is because the including class will have ActiveSupport::Rescuable mixed in
20-
T.cast(self, T.all(Module, T.class_of(ActiveSupport::Rescuable)))
21-
2218
# NOTE: rescue_from handlers are checked in reverse order.
2319
# The handler that was defined last is checked first, so put
2420
# more specific handlers at the end.

sorbet/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.
33
--ignore=tmp/
44
--ignore=vendor/
5+
--enable-experimental-requires-ancestor
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# typed: true
2+
3+
module RailsStructuredLogging::ActionMailer::ErrorHandling
4+
extend T::Helpers
5+
6+
# Tell Sorbet that we are including this module into ActionMailer::Base
7+
# and we have the rescue_from class methods available
8+
requires_ancestor { ::ActionMailer::Base }
9+
extend ::ActiveSupport::Rescuable::ClassMethods
10+
end

0 commit comments

Comments
 (0)