提交 5120429c 编写于 作者: G Geoff Buesing

TimeWithZone#advance: use #any? instead of #detect

上级 887434f7
......@@ -230,7 +230,7 @@ def ago(other)
def advance(options)
# If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time,
# otherwise advance from #utc, for accuracy when moving across DST boundaries
if options.detect {|k,v| [:years, :weeks, :months, :days].include? k}
if options.any? {|k,v| [:years, :weeks, :months, :days].include? k}
method_missing(:advance, options)
else
utc.advance(options).in_time_zone(time_zone)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册