aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/date_time
diff options
context:
space:
mode:
authorChris Baynes <binaryexp+github@gmail.com>2013-02-23 15:51:57 +0100
committerChris Baynes <binaryexp+github@gmail.com>2013-02-25 11:05:49 +0100
commitfa891a2b9dd5548d17ce3609d64142b6e31d2410 (patch)
tree5054663374c12305ffb1f0e46bb088596fbb39ff /activesupport/lib/active_support/core_ext/date_time
parentf80a6a5a39e2ec135bc0ddbdaec23979b84ef22d (diff)
downloadrails-fa891a2b9dd5548d17ce3609d64142b6e31d2410.tar.gz
rails-fa891a2b9dd5548d17ce3609d64142b6e31d2410.tar.bz2
rails-fa891a2b9dd5548d17ce3609d64142b6e31d2410.zip
Keep second fraction when DateTime#change is called.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_time')
-rw-r--r--activesupport/lib/active_support/core_ext/date_time/calculations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/calculations.rb b/activesupport/lib/active_support/core_ext/date_time/calculations.rb
index 97aad008f5..9f0864d9bb 100644
--- a/activesupport/lib/active_support/core_ext/date_time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/date_time/calculations.rb
@@ -59,7 +59,7 @@ class DateTime
options.fetch(:day, day),
options.fetch(:hour, hour),
options.fetch(:min, options[:hour] ? 0 : min),
- options.fetch(:sec, (options[:hour] || options[:min]) ? 0 : sec),
+ options.fetch(:sec, (options[:hour] || options[:min]) ? 0 : sec + sec_fraction),
options.fetch(:offset, offset),
options.fetch(:start, start)
)