diff options
author | Ari Pollak <ajp@aripollak.com> | 2012-08-14 16:33:06 -0400 |
---|---|---|
committer | Ari Pollak <ajp@aripollak.com> | 2012-08-15 13:21:57 -0400 |
commit | 53ca22f2e11cd3050d75385bc31b6bb5055a2738 (patch) | |
tree | fd60e0bb75247880fb2cb734d68b404644f80c93 /activerecord/CHANGELOG.md | |
parent | ebb4a3d5becd535074502a4bf1b61a5b18e30917 (diff) | |
download | rails-53ca22f2e11cd3050d75385bc31b6bb5055a2738.tar.gz rails-53ca22f2e11cd3050d75385bc31b6bb5055a2738.tar.bz2 rails-53ca22f2e11cd3050d75385bc31b6bb5055a2738.zip |
Fix occasional microsecond conversion inaccuracy
ActiveRecord::ConnectionAdapters::Column#microseconds did an unnecessary
conversion to from Rational to float when calculating the integer number
of microseconds. Some terminating decimal numbers in base10 are
repeating decimal numbers in base2 (the format of float), and
occasionally this causes a rounding error.
Patch & explanation originally from Logan Bowers.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index faf1bbf232..d0c747d1f2 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,11 @@ ## Rails 4.0.0 (unreleased) ## +* Fix Column.microseconds and Column.fast_string_to_date to avoid converting + timestamp seconds to a float, since it occasionally results in inaccuracies + with microsecond-precision times. Fixes #7352. + + *Ari Pollak* + * Raise `ArgumentError` if list of attributes to change is empty in `update_all`. *Roman Shatsov* |