From 9ae511f55047b2380224ad993a7d0ed97dbcf944 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Thu, 12 Jan 2017 10:02:16 +0000 Subject: Add duration constructors for use in Numeric extensions The Numeric extensions like 1.day, 1.month, etc. shouldn't know how the internals of ActiveSupport::Duration works. --- guides/source/debugging_rails_applications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/debugging_rails_applications.md b/guides/source/debugging_rails_applications.md index f12df093ad..ba0cdbf3af 100644 --- a/guides/source/debugging_rails_applications.md +++ b/guides/source/debugging_rails_applications.md @@ -683,7 +683,7 @@ Ruby instruction to be executed -- in this case, Active Support's `week` method. 51: # 52: # 2.weeks # => 14 days 53: def weeks -=> 54: ActiveSupport::Duration.new(self * ActiveSupport::Duration::PARTS_IN_SECONDS[:weeks], [[:weeks, self]]) +=> 54: ActiveSupport::Duration.weeks(self) 55: end 56: alias :week :weeks 57: -- cgit v1.2.3