Skip to content

Commit 128bb7d

Browse files
authored
actionpack: fix url_helpers to return includable module type (#977)
* actionpack: add test for url_helpers include * actionpack: fix url_helpers to return includable module type
1 parent 33aabd5 commit 128bb7d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

gems/actionpack/7.2/_test/test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ class BarController < ActionController::Base
77
end
88

99
ActionController::Base.new.render_to_string(template: 'foo', locals: { bar: 'baz' })
10+
11+
class FooService
12+
include ActionDispatch::Routing::RouteSet.new.url_helpers
13+
end

gems/actionpack/7.2/_test/test.rbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ end
33

44
class BarController < ActionController::Base
55
end
6+
7+
class FooService
8+
end

gems/actionpack/7.2/actiondispatch.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module ActionDispatch
7171
class RouteSet
7272
def draw: () { () [self: Mapper] -> untyped } -> nil
7373

74-
def url_helpers: (?bool supports_path) -> RouteSet_AnonymousModule
74+
def url_helpers: (?bool supports_path) -> singleton(RouteSet_AnonymousModule)
7575

7676
module RouteSet_AnonymousModule
7777
include ActiveSupport::Concern

0 commit comments

Comments
 (0)