aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 48606dbcff..15145a2575 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -135,7 +135,7 @@ module ActiveSupport
# If wrapped #time is a DateTime, use DateTime#since instead of #+
# Otherwise, just pass on to #method_missing
def +(other)
- result = utc.acts_like?(:date) ? utc.since(other) : utc + other
+ result = utc.acts_like?(:date) ? utc.since(other) : utc + other rescue utc.since(other)
result.in_time_zone(time_zone)
end
@@ -146,7 +146,7 @@ module ActiveSupport
if other.acts_like?(:time)
utc - other
else
- result = utc.acts_like?(:date) ? utc.ago(other) : utc - other
+ result = utc.acts_like?(:date) ? utc.ago(other) : utc - other rescue utc.ago(other)
result.in_time_zone(time_zone)
end
end