New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Ruby 2.7 warnings in Action Pack 6.0 #38051
Fix Ruby 2.7 warnings in Action Pack 6.0 #38051
Conversation
In Ruby 2.7, https://bugs.ruby-lang.org/issues/14183#note-101 In that case it is required to split kwargs manually. |
Okey I've fixed with the diff: diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb
index 1554be9ef1..5c38787b55 100644
--- a/actionpack/lib/action_dispatch/middleware/cookies.rb
+++ b/actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -571,7 +571,8 @@ def initialize(parent_jar)
secret = request.key_generator.generate_key(request.signed_cookie_salt)
@verifier = ActiveSupport::MessageVerifier.new(secret, digest: signed_cookie_digest, serializer: SERIALIZER)
- request.cookies_rotations.signed.each do |*secrets, **options|
+ request.cookies_rotations.signed.each do |(*secrets)|
+ options = secrets.extract_options!
@verifier.rotate(*secrets, serializer: SERIALIZER, **options)
end
end
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index 08019cff1d..51431fe045 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -95,7 +95,7 @@ def resolve_layout(layout, keys, formats)
end
rescue ActionView::MissingTemplate
all_details = @details.merge(formats: @lookup_context.default_formats)
- raise unless template_exists?(layout, nil, false, [], all_details)
+ raise unless template_exists?(layout, nil, false, [], **all_details)
end
when Proc
resolve_layout(layout.call(@lookup_context, formats), keys, formats) |
a86dd0c
to
5b84be7
Compare
Thanks. I applied it. |
…-warnings Fix Ruby 2.7 warnings in Action Pack 6.0
Forwardported to master in abf0465. |
Hmm I am using
|
@nezirz try using the 6-0-stable branch from git, that should fix any deprecation warnings: # Gemfile
gem 'rails', git: 'https://github.com/rails/rails', branch: '6-0-stable' |
@connorshea I have option also to hide warnings within instructions from: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ with: If you want to disable the deprecation warnings, please use a command-line argument But, I was more thinking of updating the Actionpack 6.0.2.1 for handling this warnings. |
There are a few left that I couldn't figure out:
cc @rafaelfranca @Edouard-chin @kamipo