aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorSebastian Martinez <sebastian@wyeworks.com>2011-06-14 11:01:00 -0300
committerSebastian Martinez <sebastian@wyeworks.com>2011-06-14 11:01:00 -0300
commit0c1e630d181fdf63a03ce87b70820832f22d00d8 (patch)
tree209ffa89406af9d335ec655497fdc1f78a8b27f5 /railties/guides/source/active_support_core_extensions.textile
parent10c203508415767eb0a15f9da3a48e56f552c1ce (diff)
downloadrails-0c1e630d181fdf63a03ce87b70820832f22d00d8.tar.gz
rails-0c1e630d181fdf63a03ce87b70820832f22d00d8.tar.bz2
rails-0c1e630d181fdf63a03ce87b70820832f22d00d8.zip
Prefer Time.current over Time.now on example code
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index 763e0d585b..21708e0fba 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -3327,7 +3327,7 @@ h5. +all_day+, +all_week+, +all_month+, +all_quarter+ and +all_year+
The method +all_day+ returns a range representing the whole day of the current time.
<ruby>
-now = Time.now
+now = Time.current
# => Mon, 09 Aug 2010 23:20:05 UTC +00:00
now.all_day
# => Mon, 09 Aug 2010 00:00:00 UTC +00:00..Mon, 09 Aug 2010 23:59:59 UTC +00:00
@@ -3336,7 +3336,7 @@ now.all_day
Analogously, +all_week+, +all_month+, +all_quarter+ and +all_year+ all serve the purpose of generating time ranges.
<ruby>
-now = Time.now
+now = Time.current
# => Mon, 09 Aug 2010 23:20:05 UTC +00:00
now.all_week
# => Mon, 09 Aug 2010 00:00:00 UTC +00:00..Sun, 15 Aug 2010 23:59:59 UTC +00:00