mirror of https://github.com/rails/rails
Merge pull request #38051 from Shopify/actionpack-6-0-stable-ruby-2.7-warnings
Fix Ruby 2.7 warnings in Action Pack 6.0
This commit is contained in:
parent
8ddf0c490f
commit
abf0465b09
|
@ -65,13 +65,15 @@ module AbstractController
|
|||
file, line = location.path, location.lineno
|
||||
|
||||
meths.each do |meth|
|
||||
method_def = [
|
||||
"def #{meth}(*args, &blk)",
|
||||
" controller.send(%(#{meth}), *args, &blk)",
|
||||
"end"
|
||||
].join(";")
|
||||
|
||||
_helpers.class_eval method_def, file, line
|
||||
_helpers.class_eval <<-ruby_eval, file, line
|
||||
def #{meth}(*args, **kwargs, &blk) # def current_user(*args, **kwargs, &blk)
|
||||
if kwargs.empty? # if kwargs.empty?
|
||||
controller.send(%(#{meth}), *args, &blk) # controller.send(:current_user, *args, &blk)
|
||||
else # else
|
||||
controller.send(%(#{meth}), *args, **kwargs, &blk) # controller.send(:current_user, *args, **kwargs, &blk)
|
||||
end # end
|
||||
end # end
|
||||
ruby_eval
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -578,7 +578,8 @@ module ActionDispatch
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue