Skip to content
This repository
Browse code

Added a note to the documentation for the Date related Numeric extens…

…ions to indicate that they're

approximations and shouldn't be used for critical calculations. [Koz].  Closes #4148.  References #4146


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 43398433e98f9f6a9666f53272a790035be629b4 1 parent 5568d20
Michael Koziarski NZKoz authored
3  activesupport/CHANGELOG
... ... @@ -1,5 +1,8 @@
1 1 *SVN*
2 2
  3 +* Added a note to the documentation for the Date related Numeric extensions to indicate that they're
  4 +approximations and shouldn't be used for critical calculations. [Koz]
  5 +
3 6 * Added Hash#to_xml and Array#to_xml that makes it much easier to produce XML from basic structures [DHH]. Examples:
4 7
5 8 { :name => "David", :street_name => "Paulina", :age => 26, :moved_on => Date.new(2005, 11, 15) }.to_xml
7 activesupport/lib/active_support/core_ext/numeric/time.rb
... ... @@ -1,7 +1,12 @@
1 1 module ActiveSupport #:nodoc:
2 2 module CoreExtensions #:nodoc:
3 3 module Numeric #:nodoc:
4   - # Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years
  4 + # Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years.
  5 + #
  6 + # Some of these methods are approximations, Ruby's core
  7 + # Date[http://stdlib.rubyonrails.org/libdoc/date/rdoc/index.html] and
  8 + # Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision
  9 + # date and time arithmetic
5 10 module Time
6 11 def minutes
7 12 self * 60

0 comments on commit 4339843

Please sign in to comment.
Something went wrong with that request. Please try again.