Skip to content

Commit 789e8e3

Browse files
committed
Review response to #932 (review)
1 parent 761f8f6 commit 789e8e3

File tree

6 files changed

+16
-102
lines changed

6 files changed

+16
-102
lines changed

gems/actionpack/6.0/actiondispatch.rbs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,16 @@ end
6363

6464
module ActionDispatch
6565
module Routing
66+
module PolymorphicRoutes
67+
def polymorphic_url: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
68+
def polymorphic_path: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
69+
end
70+
6671
class RouteSet
6772
def draw: () { () [self: Mapper] -> untyped } -> nil
6873

74+
def url_helpers: (?bool supports_path) -> RouteSet_AnonymousModule
75+
6976
class RouteSet_AnonymousModule
7077
include ActiveSupport::Concern
7178
include UrlFor

gems/actionpack/6.0/actionpack-generated.rbs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9704,54 +9704,6 @@ module ActionDispatch
97049704
# form_for([blog, @post]) # => "/blog/posts/1"
97059705
#
97069706
module PolymorphicRoutes
9707-
# Constructs a call to a named RESTful route for the given record and returns the
9708-
# resulting URL string. For example:
9709-
#
9710-
# # calls post_url(post)
9711-
# polymorphic_url(post) # => "http://example.com/posts/1"
9712-
# polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1"
9713-
# polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1"
9714-
# polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1"
9715-
# polymorphic_url(Comment) # => "http://example.com/comments"
9716-
#
9717-
# ==== Options
9718-
#
9719-
# * <tt>:action</tt> - Specifies the action prefix for the named route:
9720-
# <tt>:new</tt> or <tt>:edit</tt>. Default is no prefix.
9721-
# * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>.
9722-
# Default is <tt>:url</tt>.
9723-
#
9724-
# Also includes all the options from <tt>url_for</tt>. These include such
9725-
# things as <tt>:anchor</tt> or <tt>:trailing_slash</tt>. Example usage
9726-
# is given below:
9727-
#
9728-
# polymorphic_url([blog, post], anchor: 'my_anchor')
9729-
# # => "http://example.com/blogs/1/posts/1#my_anchor"
9730-
# polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app")
9731-
# # => "http://example.com/my_app/blogs/1/posts/1#my_anchor"
9732-
#
9733-
# For all of these options, see the documentation for {url_for}[rdoc-ref:ActionDispatch::Routing::UrlFor].
9734-
#
9735-
# ==== Functionality
9736-
#
9737-
# # an Article record
9738-
# polymorphic_url(record) # same as article_url(record)
9739-
#
9740-
# # a Comment record
9741-
# polymorphic_url(record) # same as comment_url(record)
9742-
#
9743-
# # it recognizes new records and maps to the collection
9744-
# record = Comment.new
9745-
# polymorphic_url(record) # same as comments_url()
9746-
#
9747-
# # the class of a record will also map to the collection
9748-
# polymorphic_url(Comment) # same as comments_url()
9749-
#
9750-
def polymorphic_url: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
9751-
9752-
# Returns the path component of a URL for the given record.
9753-
def polymorphic_path: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
9754-
97559707
private
97569708

97579709
def polymorphic_url_for_action: (untyped action, untyped record_or_hash, untyped options) -> untyped
@@ -10078,8 +10030,6 @@ module ActionDispatch
1007810030

1007910031
def define_mounted_helper: (untyped name, ?untyped? script_namer) -> (nil | untyped)
1008010032

10081-
def url_helpers: (?bool supports_path) -> RouteSet_AnonymousModule
10082-
1008310033
def empty?: () -> untyped
1008410034

1008510035
def add_route: (untyped mapping, untyped name) -> untyped

gems/actionpack/7.2/actiondispatch.rbs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,16 @@ end
6363

6464
module ActionDispatch
6565
module Routing
66+
module PolymorphicRoutes
67+
def polymorphic_url: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
68+
def polymorphic_path: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
69+
end
70+
6671
class RouteSet
6772
def draw: () { () [self: Mapper] -> untyped } -> nil
6873

74+
def url_helpers: (?bool supports_path) -> RouteSet_AnonymousModule
75+
6976
class RouteSet_AnonymousModule
7077
include ActiveSupport::Concern
7178
include UrlFor

gems/actionpack/7.2/actionpack-generated.rbs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9704,54 +9704,6 @@ module ActionDispatch
97049704
# form_for([blog, @post]) # => "/blog/posts/1"
97059705
#
97069706
module PolymorphicRoutes
9707-
# Constructs a call to a named RESTful route for the given record and returns the
9708-
# resulting URL string. For example:
9709-
#
9710-
# # calls post_url(post)
9711-
# polymorphic_url(post) # => "http://example.com/posts/1"
9712-
# polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1"
9713-
# polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1"
9714-
# polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1"
9715-
# polymorphic_url(Comment) # => "http://example.com/comments"
9716-
#
9717-
# ==== Options
9718-
#
9719-
# * <tt>:action</tt> - Specifies the action prefix for the named route:
9720-
# <tt>:new</tt> or <tt>:edit</tt>. Default is no prefix.
9721-
# * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>.
9722-
# Default is <tt>:url</tt>.
9723-
#
9724-
# Also includes all the options from <tt>url_for</tt>. These include such
9725-
# things as <tt>:anchor</tt> or <tt>:trailing_slash</tt>. Example usage
9726-
# is given below:
9727-
#
9728-
# polymorphic_url([blog, post], anchor: 'my_anchor')
9729-
# # => "http://example.com/blogs/1/posts/1#my_anchor"
9730-
# polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app")
9731-
# # => "http://example.com/my_app/blogs/1/posts/1#my_anchor"
9732-
#
9733-
# For all of these options, see the documentation for {url_for}[rdoc-ref:ActionDispatch::Routing::UrlFor].
9734-
#
9735-
# ==== Functionality
9736-
#
9737-
# # an Article record
9738-
# polymorphic_url(record) # same as article_url(record)
9739-
#
9740-
# # a Comment record
9741-
# polymorphic_url(record) # same as comment_url(record)
9742-
#
9743-
# # it recognizes new records and maps to the collection
9744-
# record = Comment.new
9745-
# polymorphic_url(record) # same as comments_url()
9746-
#
9747-
# # the class of a record will also map to the collection
9748-
# polymorphic_url(Comment) # same as comments_url()
9749-
#
9750-
def polymorphic_url: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
9751-
9752-
# Returns the path component of a URL for the given record.
9753-
def polymorphic_path: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
9754-
97559707
private
97569708

97579709
def polymorphic_url_for_action: (untyped action, untyped record_or_hash, untyped options) -> untyped
@@ -10078,8 +10030,6 @@ module ActionDispatch
1007810030

1007910031
def define_mounted_helper: (untyped name, ?untyped? script_namer) -> (nil | untyped)
1008010032

10081-
def url_helpers: (?bool supports_path) -> RouteSet_AnonymousModule
10082-
1008310033
def empty?: () -> untyped
1008410034

1008510035
def add_route: (untyped mapping, untyped name) -> untyped

gems/railties/6.0/railties-generated.rbs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4774,8 +4774,6 @@ module Rails
47744774

47754775
attr_accessor self.logger: untyped
47764776

4777-
def self.application: () -> Rails::Application
4778-
47794777
# The Configuration instance used to configure the Rails environment
47804778
def self.configuration: () -> untyped
47814779

gems/railties/6.0/railties.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module Rails
3636
end
3737

3838
module Rails
39+
def self.application: () -> Rails::Application
40+
3941
class Railties
4042
extend Initializable::ClassMethods
4143
end

0 commit comments

Comments
 (0)