diff options
author | Andrew White <andrew.white@unboxed.co> | 2017-01-12 10:02:16 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2017-01-12 10:05:16 +0000 |
commit | 9ae511f55047b2380224ad993a7d0ed97dbcf944 (patch) | |
tree | f381ee6e343edc72cc89036928737383fde690e7 /guides | |
parent | 2a5ae2b714046d3f7eb1219eb366cf84c1cf9bb5 (diff) | |
download | rails-9ae511f55047b2380224ad993a7d0ed97dbcf944.tar.gz rails-9ae511f55047b2380224ad993a7d0ed97dbcf944.tar.bz2 rails-9ae511f55047b2380224ad993a7d0ed97dbcf944.zip |
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.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/debugging_rails_applications.md | 2 |
1 files changed, 1 insertions, 1 deletions
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: |