aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/duration/iso8601_serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/duration/iso8601_serializer.rb')
-rw-r--r--activesupport/lib/active_support/duration/iso8601_serializer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/duration/iso8601_serializer.rb b/activesupport/lib/active_support/duration/iso8601_serializer.rb
index 542630b950..39b1b40e72 100644
--- a/activesupport/lib/active_support/duration/iso8601_serializer.rb
+++ b/activesupport/lib/active_support/duration/iso8601_serializer.rb
@@ -37,7 +37,7 @@ module ActiveSupport
# Zero parts are removed as not significant.
# If all parts are negative it will negate all of them and return minus as a sign.
def normalize
- parts = @duration.parts.each_with_object(Hash.new(0)) do |(k,v),p|
+ parts = @duration.parts.each_with_object(Hash.new(0)) do |(k, v), p|
p[k] += v unless v.zero?
end
# If all parts are negative - let's make a negative duration