aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time/calculations.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-03-05 08:34:42 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-03-05 08:34:42 +0000
commitdf57f53d09575f8bc6542f87a3384240b66f9b4b (patch)
treed6644d733c525485ca9b8a968b12aec31387adf1 /activesupport/lib/active_support/core_ext/time/calculations.rb
parent28628858bebbade2501dfa329b96f921aad90dde (diff)
downloadrails-df57f53d09575f8bc6542f87a3384240b66f9b4b.tar.gz
rails-df57f53d09575f8bc6542f87a3384240b66f9b4b.tar.bz2
rails-df57f53d09575f8bc6542f87a3384240b66f9b4b.zip
Time#since overflows to DateTime. Introduce Time#to_datetime. Closes #7715.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time/calculations.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index 1c2daf0606..1fdfbcdf45 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -91,6 +91,8 @@ module ActiveSupport #:nodoc:
f = seconds.since(self)
final_dst = f.dst? ? 1 : 0
(seconds.abs >= 86400 && initial_dst != final_dst) ? f + (initial_dst - final_dst).hours : f
+ rescue
+ self.to_datetime.since(seconds)
end
alias :in :since