aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2016-08-03 14:45:09 +0100
committerAndrew White <andrew.white@unboxed.co>2016-08-03 14:45:09 +0100
commit0e762ecdc3026d0c2191e42fbca8021da9ec34cc (patch)
treeffe76cc5fe509b0f03ffab33db1dfa377fee0116 /activesupport/lib
parentfac9938b917f3417a19775d1c6905123fc402256 (diff)
downloadrails-0e762ecdc3026d0c2191e42fbca8021da9ec34cc.tar.gz
rails-0e762ecdc3026d0c2191e42fbca8021da9ec34cc.tar.bz2
rails-0e762ecdc3026d0c2191e42fbca8021da9ec34cc.zip
Add :weeks to the list of variable duration parts
Since 434df00 week durations are no longer converted to days. This means we need to add :weeks to the parts that ActiveSupport::TimeWithZone will consider being of variable duration to take account of DST transitions. Fixes #26039.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index b1cec43124..d7c35e1950 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -481,7 +481,7 @@ module ActiveSupport
end
def duration_of_variable_length?(obj)
- ActiveSupport::Duration === obj && obj.parts.any? {|p| [:years, :months, :days].include?(p[0]) }
+ ActiveSupport::Duration === obj && obj.parts.any? {|p| [:years, :months, :weeks, :days].include?(p[0]) }
end
def wrap_with_time_zone(time)