diff options
author | Alexey Gaziev <alex.gaziev@gmail.com> | 2012-05-07 22:40:59 +0400 |
---|---|---|
committer | Alexey Gaziev <alex.gaziev@gmail.com> | 2012-05-07 23:56:27 +0400 |
commit | d785b292a8c921989f606696dff3765836d1fb44 (patch) | |
tree | 6e63d6ee40bbb44ded56dea255cb4d8c8d1596e5 /guides/source | |
parent | 8b67a022ec8754e5dab8df2a8bbec37df61a5fc2 (diff) | |
download | rails-d785b292a8c921989f606696dff3765836d1fb44.tar.gz rails-d785b292a8c921989f606696dff3765836d1fb44.tar.bz2 rails-d785b292a8c921989f606696dff3765836d1fb44.zip |
Changes for numeric api for Time because Time.current works different
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_support_core_extensions.textile | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/active_support_core_extensions.textile b/guides/source/active_support_core_extensions.textile index 4bee3e400e..52c1cea4b9 100644 --- a/guides/source/active_support_core_extensions.textile +++ b/guides/source/active_support_core_extensions.textile @@ -184,7 +184,7 @@ You can evaluate code in the context of any object's singleton class using +clas <ruby> class Proc def bind(object) - block, time = self, Time.now + block, time = self, Time.current object.class_eval do method_name = "__bind_#{time.to_i}_#{time.usec}" define_method(method_name, &block) @@ -1780,13 +1780,13 @@ These methods use Time#advance for precise date calculations when using from_now as well as adding or subtracting their results from a Time object. For example: <ruby> -# equivalent to Time.now.advance(:months => 1) +# equivalent to Time.current.advance(:months => 1) 1.month.from_now -# equivalent to Time.now.advance(:years => 2) +# equivalent to Time.current.advance(:years => 2) 2.years.from_now -# equivalent to Time.now.advance(:months => 4, :years => 5) +# equivalent to Time.current.advance(:months => 4, :years => 5) (4.months + 5.years).from_now </ruby> |