mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove another unnecessary dup
This commit is contained in:
parent
bdaafae550
commit
8ef780c3e2
1 changed files with 3 additions and 5 deletions
|
@ -37,18 +37,16 @@ module ActionDispatch
|
|||
private
|
||||
|
||||
def extract_parameterized_parts(route, options, recall, parameterize = nil)
|
||||
data = recall.merge(options)
|
||||
parameterized_parts = recall.merge(options)
|
||||
|
||||
keys_to_keep = route.parts.reverse.drop_while { |part|
|
||||
!options.key?(part) || (options[part] || recall[part]).nil?
|
||||
} | route.required_parts
|
||||
|
||||
(data.keys - keys_to_keep).each do |bad_key|
|
||||
data.delete(bad_key)
|
||||
(parameterized_parts.keys - keys_to_keep).each do |bad_key|
|
||||
parameterized_parts.delete(bad_key)
|
||||
end
|
||||
|
||||
parameterized_parts = data.dup
|
||||
|
||||
if parameterize
|
||||
parameterized_parts.each do |k, v|
|
||||
parameterized_parts[k] = parameterize.call(k, v)
|
||||
|
|
Loading…
Reference in a new issue