提交 fcfe6931 编写于 作者: R Ryuta Kamizono

Revert "Merge pull request #37839 from...

Revert "Merge pull request #37839 from ttanimichi/modify-inspect-of-activesupport-duration-with-no-parts"

This reverts commit 01d7f82c.
上级 ef874b5a
......@@ -372,7 +372,7 @@ def ago(time = ::Time.current)
alias :before :ago
def inspect #:nodoc:
return "#{value} seconds" if parts.empty?
return "0 seconds" if parts.empty?
parts.
sort_by { |unit, _ | PARTS.index(unit) }.
......
......@@ -74,7 +74,6 @@ def test_inspect
assert_equal "2 weeks", 1.fortnight.inspect
assert_equal "0 seconds", (10 % 5.seconds).inspect
assert_equal "10 minutes", (10.minutes + 0.seconds).inspect
assert_equal "3600 seconds", (1.day / 24).inspect
end
def test_inspect_locale
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册