Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactored LinkRenderer#symbolized_update not to have a return statem…

…ent in the iterator
  • Loading branch information...
commit a27e20261a0f763ee813643073de1f911e2cb51f 1 parent e8cea1b
@mislav authored
Showing with 5 additions and 9 deletions.
  1. +5 −9 lib/will_paginate/view_helpers/link_renderer.rb
View
14 lib/will_paginate/view_helpers/link_renderer.rb
@@ -117,16 +117,12 @@ def symbolized_update(target, other)
other.each do |key, value|
key = key.to_sym
existing = target[key]
-
- if value.is_a?(Hash)
- target[key] = existing = {} if existing.nil?
- if existing.is_a?(Hash)
- symbolized_update(existing, value)
- return
- end
- end
- target[key] = value
+ if value.is_a?(Hash) and (existing.is_a?(Hash) or existing.nil?)
+ symbolized_update(existing || (target[key] = {}), value)
+ else
+ target[key] = value
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.