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:
Ryuta Kamizono 2019-12-20 22:49:45 +09:00
parent 8ddf0c490f
commit abf0465b09
2 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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