aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time/conversions.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-29 23:12:34 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-29 23:12:34 -0700
commit091965c0fc7384c17cce9e71a80f515b1139d460 (patch)
tree46a38eb4ba7a1743d18d7dfa41b27009f7f925ec /activesupport/lib/active_support/core_ext/time/conversions.rb
parentdb892ea77563dadb6fbbd242be78ff87321d0bd1 (diff)
downloadrails-091965c0fc7384c17cce9e71a80f515b1139d460.tar.gz
rails-091965c0fc7384c17cce9e71a80f515b1139d460.tar.bz2
rails-091965c0fc7384c17cce9e71a80f515b1139d460.zip
Prefer behavior check to RUBY_VERSION to catch 1.8 backports
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time/conversions.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/time/conversions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/conversions.rb b/activesupport/lib/active_support/core_ext/time/conversions.rb
index 18261e139f..94e01597a9 100644
--- a/activesupport/lib/active_support/core_ext/time/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/time/conversions.rb
@@ -63,7 +63,7 @@ class Time
# your_time.to_date # => Tue, 13 Jan 2009
def to_date
::Date.new(year, month, day)
- end
+ end unless method_defined?(:to_date)
# A method to keep Time, Date and DateTime instances interchangeable on conversions.
# In this case, it simply returns +self+.
@@ -80,5 +80,5 @@ class Time
# your_time.to_datetime # => Tue, 13 Jan 2009 13:13:03 -0500
def to_datetime
::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400))
- end
+ end unless method_defined?(:to_datetime)
end