mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Unify rotate method definitions to take keyword arguments
This commit is contained in:
parent
a08a069acd
commit
491ab85207
1 changed files with 11 additions and 3 deletions
|
@ -9,14 +9,22 @@ module ActiveSupport
|
|||
@signed, @encrypted = [], []
|
||||
end
|
||||
|
||||
def rotate(kind, *args)
|
||||
def rotate(kind, *args, **options)
|
||||
case kind
|
||||
when :signed
|
||||
if options&.any?
|
||||
@signed << (args << options)
|
||||
else
|
||||
@signed << args
|
||||
end
|
||||
when :encrypted
|
||||
if options&.any?
|
||||
@encrypted << (args << options)
|
||||
else
|
||||
@encrypted << args
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue