From c766f3e4b013cf4bcc4ad9ba64636bbf944b320c Mon Sep 17 00:00:00 2001 From: Pawel Pierzchala Date: Thu, 5 Jan 2012 11:02:14 +0100 Subject: Nano seconds fraction of time is copied properly in Time#advance When day, month or year was passed, advance created a new time ignoring previous nsec fraction. Now nsec is passed through usec as a Rational number. --- activesupport/lib/active_support/core_ext/time/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index f3235d11bb..5e433f5dd9 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -78,7 +78,7 @@ class Time options[:hour] || hour, options[:min] || (options[:hour] ? 0 : min), options[:sec] || ((options[:hour] || options[:min]) ? 0 : sec), - options[:usec] || ((options[:hour] || options[:min] || options[:sec]) ? 0 : usec) + options[:usec] || ((options[:hour] || options[:min] || options[:sec]) ? 0 : Rational(nsec, 1000)) ) end -- cgit v1.2.3