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,12 +9,20 @@ module ActiveSupport
|
||||||
@signed, @encrypted = [], []
|
@signed, @encrypted = [], []
|
||||||
end
|
end
|
||||||
|
|
||||||
def rotate(kind, *args)
|
def rotate(kind, *args, **options)
|
||||||
case kind
|
case kind
|
||||||
when :signed
|
when :signed
|
||||||
@signed << args
|
if options&.any?
|
||||||
|
@signed << (args << options)
|
||||||
|
else
|
||||||
|
@signed << args
|
||||||
|
end
|
||||||
when :encrypted
|
when :encrypted
|
||||||
@encrypted << args
|
if options&.any?
|
||||||
|
@encrypted << (args << options)
|
||||||
|
else
|
||||||
|
@encrypted << args
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue