diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-05 08:34:42 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-05 08:34:42 +0000 |
commit | df57f53d09575f8bc6542f87a3384240b66f9b4b (patch) | |
tree | d6644d733c525485ca9b8a968b12aec31387adf1 /activesupport/lib/active_support/core_ext/date_time | |
parent | 28628858bebbade2501dfa329b96f921aad90dde (diff) | |
download | rails-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/date_time')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/conversions.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/conversions.rb b/activesupport/lib/active_support/core_ext/date_time/conversions.rb index 48a13e1fde..926a168cec 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -22,6 +22,11 @@ module ActiveSupport #:nodoc: def to_date ::Date.new(year, month, day) end + + # To be able to keep Times and DateTimes interchangeable on conversions + def to_datetime + self + end end end end |