aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2017-01-12 07:20:28 +0000
committerGitHub <noreply@github.com>2017-01-12 07:20:28 +0000
commit033f6540270ea84e7579a585c657ed2c3bcf0ee0 (patch)
treefd58e999e3e198742b76a38f7b848eb0d7f4349e /guides/source
parent37f889b4a2d8862fb7c6939e5bd6be5897a587b1 (diff)
parentcb9d0e4864fa68fad9c49b880c32e90ddf0545bd (diff)
downloadrails-033f6540270ea84e7579a585c657ed2c3bcf0ee0.tar.gz
rails-033f6540270ea84e7579a585c657ed2c3bcf0ee0.tar.bz2
rails-033f6540270ea84e7579a585c657ed2c3bcf0ee0.zip
Merge pull request #27610 from Envek/fix_and_speed_up_duration_parsing
Fix inconsistent parsing of Durations with both months and years
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/debugging_rails_applications.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/debugging_rails_applications.md b/guides/source/debugging_rails_applications.md
index df3003a6a8..f12df093ad 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 * 7.days, [[:days, self * 7]])
+=> 54: ActiveSupport::Duration.new(self * ActiveSupport::Duration::PARTS_IN_SECONDS[:weeks], [[:weeks, self]])
55: end
56: alias :week :weeks
57: