aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/duration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/duration.rb')
-rw-r--r--activesupport/lib/active_support/duration.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb
index 3bde541009..47d09f4f5a 100644
--- a/activesupport/lib/active_support/duration.rb
+++ b/activesupport/lib/active_support/duration.rb
@@ -159,8 +159,10 @@ module ActiveSupport
if t.acts_like?(:time) || t.acts_like?(:date)
if type == :seconds
t.since(sign * number)
- elsif [:hours, :minutes].include?(type)
- t.in_time_zone.advance(type => sign * number)
+ elsif type == :minutes
+ t.since(sign * number * 60)
+ elsif type == :hours
+ t.since(sign * number * 3600)
else
t.advance(type => sign * number)
end