mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix Ruby 2.7 keyword arguments warning
Partially addresses #39227. Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
This commit is contained in:
parent
ae46546ea3
commit
1ecd39d8bd
2 changed files with 10 additions and 2 deletions
|
@ -107,6 +107,7 @@ module ActionDispatch
|
|||
@_routes = nil
|
||||
super
|
||||
end
|
||||
ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)
|
||||
|
||||
# Hook overridden in controller to add request information
|
||||
# with +default_url_options+. Application logic should not
|
||||
|
|
|
@ -126,12 +126,19 @@ module TestGenerationPrefix
|
|||
end
|
||||
end
|
||||
|
||||
module KwObject
|
||||
def initialize(kw:)
|
||||
end
|
||||
end
|
||||
|
||||
class EngineObject
|
||||
include KwObject
|
||||
include ActionDispatch::Routing::UrlFor
|
||||
include BlogEngine.routes.url_helpers
|
||||
end
|
||||
|
||||
class AppObject
|
||||
include KwObject
|
||||
include ActionDispatch::Routing::UrlFor
|
||||
include RailsApplication.routes.url_helpers
|
||||
end
|
||||
|
@ -144,8 +151,8 @@ module TestGenerationPrefix
|
|||
|
||||
def setup
|
||||
RailsApplication.routes.default_url_options = {}
|
||||
@engine_object = EngineObject.new
|
||||
@app_object = AppObject.new
|
||||
@engine_object = EngineObject.new(kw: 1)
|
||||
@app_object = AppObject.new(kw: 2)
|
||||
end
|
||||
|
||||
include BlogEngine.routes.mounted_helpers
|
||||
|
|
Loading…
Reference in a new issue